Commit fdc6971f authored by Etienne Nadji's avatar Etienne Nadji

Initial commit

	nouveau fichier : README.md
	nouveau fichier : emissions.xsl
	nouveau fichier : reco.opml
	nouveau fichier : reco.xml
	nouveau fichier : style.css
	nouveau fichier : toOpml.py
parents
# Internet Cultural Programs
Liste d’émissions culturelles et/ou sérieuses sur Internet.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" />
<xsl:template match="/">
<html>
<head>
<meta charset="utf-8" />
<title>Émissions culturelles sur Internet</title>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet" />
<link rel='stylesheet' type='text/css' href='style.css'/>
</head>
<body>
<div id="content">
<nav><a href="http://etnadji.fr/" class="bread">Et.Nadji.fr</a> > <a href="http://etnadji.fr/nonpro.html" class="bread">Non pro</a> > Émissions > Recommandations</nav>
<header>
<hr/>
<h1>Émissions culturelles sur Internet</h1>
<hr/>
</header>
<h2>À propos</h2>
<h3>Contenu</h3>
<p>
Ce document a pour ambition de lister la plupart des émissions
culturelles, ou tout du moins «&#160;sérieuses&#160;» présentes
sur Internet.
</p>
<p>
À ce jour, <xsl:value-of select="count(//emission)"/> émissions
font partie de cette liste.
</p>
<h3>Legende</h3>
<p>&#xf269; Sites web divers.</p>
<p>&#xf09e; Flux <a href="http://sametmax.com/quest-ce-quun-flux-rss-et-a-quoi-ca-sert/">RSS</a>.</p>
<p>&#xf1c8; Youtube, liens directs vers de la vidéo.</p>
<p>&#xf099; Compte Twitter.</p>
<p>&#xf1ed; Moyens de soutenir l’émission: Tipee, vente de T-Shirts, livres…</p>
<h3>OPML</h3>
<p>
Une version OPML, mise à jour de temps en temps est
disponible <a href="http://etnadji.fr/emissions/reco.opml">ici</a>.
</p>
<p>
Cette version exclut tout les liens ne pointant pas vers du RSS mais
comporte des liens RSS créés automatiquement à partir des
adresses de chaines Youtube.
</p>
<p>
Pour une obtenir une version OPML forcément à jour, téléchargez
<a href="http://etnadji.fr/emissions/reco.xml">ce même document XML</a>
et transformez le à l’aide de
<a href="http://etnadji.fr/emissions/toOpml.py">ce script Python</a>.
</p>
<hr/>
<h2>Sommaire</h2>
<!-- Table des matières -->
<xsl:for-each select="/emissions/category">
<xsl:sort select="@name" order="ascending" data-type="text" />
<p class="toc">
<a href="#{@anchor}"><span class="toch"><xsl:value-of select="@name" /></span></a><br/>
<xsl:for-each select="subCategory">
<xsl:sort select="@name" order="ascending" data-type="text" />
<a href="#{@anchor}"><span class="toci"><xsl:value-of select="@name" /></span></a><br/>
</xsl:for-each>
</p>
</xsl:for-each>
<!-- Contenu -->
<xsl:for-each select="/emissions/category">
<xsl:sort select="@name" order="ascending" data-type="text" />
<hr/>
<h2 id="{@anchor}"><xsl:value-of select="@name" /></h2>
<xsl:apply-templates select="emission"/>
<xsl:for-each select="subCategory">
<xsl:sort select="@name" order="ascending" data-type="text" />
<h3 id="{@anchor}"><xsl:value-of select="@name" /></h3>
<xsl:apply-templates select="emission"/>
</xsl:for-each>
</xsl:for-each>
<hr/>
<footer>Dernière mise à jour: <xsl:value-of select="/emissions/update"/>.</footer>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="/emissions/category/emission">
<h3><xsl:value-of select="title" /></h3>
<p class="desc"><xsl:value-of select="desc" /></p>
<ul>
<xsl:for-each select="links/url">
<xsl:sort select="@type" order="ascending" data-type="text" />
<xsl:choose>
<xsl:when test="@type = 'web'">
<li>&#xf269; <a href="{.}"><xsl:value-of select="." /></a></li>
</xsl:when>
<xsl:when test="@type = 'rss'">
<li>&#xf09e; <a href="{.}"><xsl:value-of select="." /></a></li>
</xsl:when>
<xsl:when test="@type = 'yt'">
<li>&#xf1c8; <a href="https://www.youtube.com/{.}"> youtube.com/<xsl:value-of select="." /></a></li>
<xsl:if test="starts-with(.,'user/')">
<li>
&#xf09e; <a href="https://www.youtube.com/feeds/videos.xml?user={substring-after(.,'user/')}">
youtube.com/feeds/videos.xml?user=<xsl:value-of select="substring-after(.,'user/')" />
</a>
</li>
</xsl:if>
<xsl:if test="starts-with(.,'channel/')">
<li>
&#xf09e; <a href="https://www.youtube.com/feeds/videos.xml?channel_id={substring-after(.,'channel/')}">
youtube.com/feeds/videos.xml?channel_id=<xsl:value-of select="substring-after(.,'channel/')" />
</a>
</li>
</xsl:if>
</xsl:when>
<xsl:when test="@type = 'tw'">
<li>&#xf099; <a href="https://twitter.com/{.}">@<xsl:value-of select="." /></a></li>
</xsl:when>
<xsl:when test="@type = 'money'">
<xsl:choose>
<xsl:when test="starts-with(.,'tipee/')">
<li>
&#xf1ed;
<a href="https://www.tipeee.com/{substring-after(.,'tipee/')}">
tipeee.com/<xsl:value-of select="substring-after(.,'tipee/')" />
</a>
</li>
</xsl:when>
<xsl:otherwise>
<li>&#xf1ed; <a href="{.}"><xsl:value-of select="." /></a></li>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<li><a href="{.}"><xsl:value-of select="." /></a></li>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template match="/emissions/category/subCategory/emission">
<h4><xsl:value-of select="title" /></h4>
<p class="desc"><xsl:value-of select="desc" /></p>
<ul>
<xsl:for-each select="links/url">
<xsl:sort select="@type" order="ascending" data-type="text" />
<xsl:choose>
<xsl:when test="@type = 'web'">
<li>&#xf269; <a href="{.}"><xsl:value-of select="." /></a></li>
</xsl:when>
<xsl:when test="@type = 'rss'">
<li>&#xf09e; <a href="{.}"><xsl:value-of select="." /></a></li>
</xsl:when>
<xsl:when test="@type = 'yt'">
<li>&#xf1c8; <a href="https://www.youtube.com/{.}">youtube.com/<xsl:value-of select="." /></a></li>
<xsl:if test="starts-with(.,'user/')">
<li>
&#xf09e; <a href="https://www.youtube.com/feeds/videos.xml?user={substring-after(.,'user/')}">
youtube.com/feeds/videos.xml?user=<xsl:value-of select="substring-after(.,'user/')" />
</a>
</li>
</xsl:if>
<xsl:if test="starts-with(.,'channel/')">
<li>
&#xf09e; <a href="https://www.youtube.com/feeds/videos.xml?channel_id={substring-after(.,'channel/')}">
youtube.com/feeds/videos.xml?channel_id=<xsl:value-of select="substring-after(.,'channel/')" />
</a>
</li>
</xsl:if>
</xsl:when>
<xsl:when test="@type = 'tw'">
<li>&#xf099; <a href="https://twitter.com/{.}">@<xsl:value-of select="." /></a></li>
</xsl:when>
<xsl:when test="@type = 'money'">
<xsl:choose>
<xsl:when test="starts-with(.,'tipee/')">
<li>
&#xf1ed;
<a href="https://www.tipeee.com/{substring-after(.,'tipee/')}">
tipeee.com/<xsl:value-of select="substring-after(.,'tipee/')" />
</a>
</li>
</xsl:when>
<xsl:otherwise>
<li>&#xf1ed; <a href="{.}"><xsl:value-of select="." /></a></li>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<li><a href="{.}"><xsl:value-of select="." /></a></li>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="utf-8"?>
<opml version="2.0">
<head>
<title>Recommandations d'émissions</title>
<dateCreated>01/01/2015</dateCreated>
</head>
<body>
<outline text="" title="La vidéothèque d’Alexandrie" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCsqvprYnU8J8K449VAQZhsQ"/>
<outline text="" title="Head Bang" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCfsKk7Rd5wEkGMPdZvqvHmA"/>
<outline text="" title="Confér’ENS" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC_ZChHhr5nDrUymz7qsRqRw"/>
<outline text="" title="DOXA" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=DanyCaligula"/>
<outline text="" title="Le coup de Phil" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=LeCoupdePhil"/>
<outline text="" title="Epic teaching of the history" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=EpicTeachingHistory"/>
<outline text="" title="Histoire brève" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=histoirebreve"/>
<outline text="" title="Nota Bene" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=notabenemovies"/>
<outline text="" title="Parlons Y-stoire" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=ParlonsYstoire"/>
<outline text="" title="Pour la petite histoire" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCFAR8XqMHTSB32e7okK0DWw"/>
<outline text="" title="La prof" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCgk2_ngj9EVfQdnWNtOPINg"/>
<outline text="" title="Temps Mort" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCJLsfsSpIiUBPvYYSUAclrw"/>
<outline text="" title="Le Psylab" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=lepsylab"/>
<outline text="" title="Une araignée au plafond" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=Khertanis"/>
<outline text="" title="Psynect" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCwWCBw7M0kskNlv0coVP53w"/>
<outline text="" title="Cygnification" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=CygnificationCNV"/>
<outline text="" title="Anthropodcast" type="rss" xmlUrl="http://www.anthropodcast.fr/feed/podcast"/>
<outline text="" title="Code MU" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=codemutv"/>
<outline text="" title="Linguisticae" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCofQxJWd4qkqc7ZgaLkZfcw"/>
<outline text="" title="Stupid Economics" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCyJDHgrsUKuWLe05GvC2lng"/>
<outline text="" title="Epenser" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=epenser1"/>
<outline text="" title="Kurzgesagt / In a Nutshell" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=Kurzgesagt"/>
<outline text="" title="La tronche en biais" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=TroncheEnBiais"/>
<outline text="" title="Climen" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=Flexouz"/>
<outline text="" title="Dirty Biology" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=dirtybiology"/>
<outline text="" title="Veritasium" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=1veritasium"/>
<outline text="" title="Lanterne Cosmique" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=lanternecosmique"/>
<outline text="" title="Motorsport Gigantoraptor" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=AstroPaleoBMW"/>
<outline text="" title="Primum non nocere" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC9BnGZLT4iPaJtDOXYwQuHQ"/>
<outline text="" title="Adaptation" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=GingerForce01"/>
<outline text="" title="Alchimie d’un roman" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user="/>
<outline text="" title="Comme du papier à musique" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCWh-WOr-hIl3IbhxhJAo7eA"/>
<outline text="" title="La brigade du livre" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCO-YDXoZJNVJFmF1UJ17rEw"/>
<outline text="" title="Miss Book" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC_9Z28lA28JxAgFv-m4_nlw"/>
<outline text="" title="Cordélia aime" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=cordeliaaime"/>
<outline text="" title="Ça peut pas faire de mal" type="rss" xmlUrl="http://radiofrance-podcast.net/podcast09/rss_11262.xml"/>
<outline text="" title="Le Marque-Page" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCJgYXYDJV9UZfxMcKuvc-0g"/>
<outline text="" title="Les renards hâtifs" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC2OcP_onh0h94tlX6xbYOyQ"/>
<outline text="" title="Bulledop" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=bulledop"/>
<outline text="" title="Too many books" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCI_-NEEVSy3oyNqTnegZcYg"/>
<outline text="" title="Indie Mag" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=IndieMagFR"/>
<outline text="" title="Ça Cartouche" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC2kauIt-F5zjQVjQU4V-bkA"/>
<outline text="" title="Esthèt’geek" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=SamaiCedlart"/>
<outline text="" title="L’Aparté" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=SamaiCedlart"/>
<outline text="" title="Na’R’t" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCQq9fMRQhXOyOZeageaj6ag"/>
<outline text="" title="Partoche" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=tyllbiss"/>
<outline text="" title="Le set barré" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=LeSetBarre"/>
<outline text="" title="Metalliquoi" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=Metalliquoi"/>
<outline text="" title="2guys1tv" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=2guys1tv"/>
<outline text="" title="Enjoy the noise" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=Ticheurte"/>
<outline text="" title="Breakfast in backstage" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCIGBwNwDKxjCOUE-0HxtVLw"/>
<outline text="" title="After Bit" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=ChroniqueAfterBit"/>
<outline text="" title="Open MetalCast" type="rss" xmlUrl="http://feeds.feedburner.com/OpenMetalcast/ogg"/>
<outline text="" title="Les démons du MIDI" type="rss" xmlUrl="http://dl.radiojv.com/feeds/podcast_lddm.xml"/>
<outline text="" title="Le disquaire" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=TheRumol"/>
<outline text="" title="Le fossoyeur de films" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=deadwattsofficiel"/>
<outline text="" title="CGM" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=Gorkab"/>
<outline text="" title="Parlons VF" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=ParlonsVF"/>
<outline text="" title="Monsieur 3D" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=Monsieur3D"/>
<outline text="" title="Unknown Movies" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=INTHEPANDA"/>
<outline text="" title="Yohann from outer space" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCw9pOgsObfIcsrZ5n-pQq_g"/>
<outline text="" title="C’est pas si mal!" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=ElFarfadosh"/>
<outline text="" title="Le Ciné-Club" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC26kpT_AaJz8fxmAXtaGpdg"/>
<outline text="" title="Les chroniques de Vesper" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=ChroniquesDeVesper"/>
<outline text="" title="La séance infuse" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=betatestmode"/>
<outline text="" title="On va faire cours" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=betatestmode"/>
<outline text="" title="Les Clichés Ca Fait Ch###" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCN2fQteC9VUUK6JmjVGr49g"/>
<outline text="" title="Pilote" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCvHft8Duo4NaHsxQr2l9TOA"/>
<outline text="" title="Les showrunners" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UClQVvXqYz7hyFNtvechntbA"/>
<outline text="" title="Broadcasting Bino" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCAAF-RcPGghehhrzvHI--sw"/>
<outline text="" title="Y’a plus de saisons" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCXeFGMYmnHQJd7Yu4B_gxXA"/>
<outline text="" title="Mange tes navets" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCN8jtQ5bmkCVCES81VckKBQ"/>
<outline text="" title="NEXUS VI" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC8-UThnwzBI5ApzVG4MY7VQ"/>
<outline text="" title="Lex Tutor" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=NunyaFR"/>
<outline text="" title="Juris World" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCb6025XQHwwjuX0AVLBnxvw"/>
</body>
</opml>
This diff is collapsed.
nav,header,footer {text-align:center;}
h1 {font-variant: small-caps;}
h2 {color:red;text-align:center;}
h3 {color:green;}
h4 {font-weight:bold;}
ul {list-style-type: none;}
a.bread {color:blue;}
nav {font-weight:bold; color:green;}
#content {background-color:white;margin-left:25%;margin-right:25%;}
a {text-decoration:none;}
p {text-align:justify;}
.toc{margin-left:10%;margin-right:10%;}
.toch {font-size:Larger;font-weight:bold;}
.toci {margin-left:5%;}
.desc {margin-left:6%;}
#!/usr/bin/python3
# -*- coding:Utf-8 -*-
# Imports ===============================================================#
import os
import sys
import xml.etree.ElementTree as ET
# Programme =============================================================#
def get_datas(xml_file):
def _parse_emission(emissions,main_elem):
e = {"title":None,"urls":[]}
for elem in main_elem:
if elem.tag == "title":
e["title"] = elem.text
if elem.tag == "links":
for link in elem:
if link.tag == "url":
for v in link.attrib.values():
if v == "rss":
e["urls"].append(link.text)
if v == "yt":
if link.text.startswith('user/'):
e["urls"].append(
"https://www.youtube.com/feeds/videos.xml?user={0}".format(
link.text.split('/')[-1]
)
)
if link.text.startswith('channel/'):
e["urls"].append(
"https://www.youtube.com/feeds/videos.xml?channel_id={0}".format(
link.text.split('/')[-1]
)
)
if len(e["urls"]) > 0:
emissions.append(e)
return emissions
xml_parsed = ET.parse(xml_file)
xml_root = xml_parsed.getroot()
emissions = []
update = None
for supElem in xml_root:
if supElem.tag == "update":
update = supElem.text
if supElem.tag == "category":
for subElem in supElem:
if subElem.tag == "emission":
emissions = _parse_emission(emissions,subElem)
if subElem.tag == "subCategory":
for elem in subElem:
if elem.tag == "emission":
emissions = _parse_emission(emissions,elem)
return {"update":update,"emissions":emissions}
def write_opml(datas):
def _get_emission_text(emission):
title = ""
if emission["title"] is not None:
title = 'title="{0}" '.format(emission["title"])
if len(emission["urls"]) > 1:
ret = ''
for url in emission["urls"]:
url = 'xmlUrl="{0}"'.format(url)
ret += '\t<outline text="" {0}type="rss" {1}/>\n'.format(title,url)
return ret
else:
url = 'xmlUrl="{0}"'.format(emission["urls"][0])
return '\t<outline text="" {0}type="rss" {1}/>\n'.format(title,url)
if datas:
with open("reco.opml","w") as opmlf:
opmlf.write('<?xml version="1.0" encoding="utf-8"?>\n')
opmlf.write('<opml version="2.0">\n')
opmlf.write('<head>\n')
opmlf.write('\t<title>Recommandations d\'émissions</title>\n')
if datas["update"] is not None:
opmlf.write('\t<dateCreated>{0}</dateCreated>\n'.format(datas["update"]))
opmlf.write('</head>\n')
opmlf.write('<body>\n')
for emission in datas["emissions"]:
opmlf.write(_get_emission_text(emission))
opmlf.write('</body>\n')
opmlf.write('</opml>\n')
if __name__ == "__main__":
datas = get_datas("reco.xml")
write_opml(datas)
# vim:set shiftwidth=4 softtabstop=4:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment