Attention ! Gitlab fournissant maintenant nativement des certificats Let’s Encrypt aux domaines personnalisés des Gitlab Pages, nous avons coupé notre service qui le faisait automatiquement pour vous.

Il est impératif, pour que votre domaine personnalisé continue à avoir un certificat Let’s Encrypt à jour, d’activer la fonctionnalité native dans les paramètres de votre projet. Cette activation remplacera votre certificat actuel par un nouveau certificat Let’s Encrypt géré par Gitlab.

Voir les détails sur https://docs.framasoft.org/fr/gitlab/gitlab-pages-le.html

Commit e77eba58 authored by Etienne Nadji's avatar Etienne Nadji

OPML (doublons corrigés)

	modifié :         reco.opml
	renommé :         toOpml.py -> toOpmlNext.py
parent 91183f5f
......@@ -37,7 +37,6 @@
<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="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="The Art of Language Invention" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCgJSf-fmdfUsSlcr7A92-aA"/>
......@@ -89,8 +88,6 @@
<outline text="" title="Un peu pointu" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCj2sb4hak2L_UpW-1AQ6Qhw"/>
<outline text="" title="La tronche en biais" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=TroncheEnBiais"/>
<outline text="" title="Le monde merveilleux du scepticisme" type="rss" xmlUrl="http://www.lmmds.ca/feed/"/>
<outline text="" title="Le monde merveilleux du scepticisme" type="rss" xmlUrl="http://www.lmmds.ca/feed/"/>
<outline text="" title="Scepticisme scientifique" type="rss" xmlUrl="http://www.scepticisme-scientifique.com/feed/"/>
<outline text="" title="Scepticisme scientifique" type="rss" xmlUrl="http://www.scepticisme-scientifique.com/feed/"/>
<outline text="" title="Mycéliums" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCJ9kIKgFuAB23GkEko1hHDg"/>
<outline text="" title="Mycéliums" type="rss" xmlUrl="http://myceliums.fr/feed/rss"/>
......@@ -140,6 +137,8 @@
<outline text="" title="REG’art" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCjTZULESrd3WLIEhs6rfMQw"/>
<outline text="" title="Philobjet" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCRsW-j1P1z--sOejIRazDUw"/>
<outline text="" title="Muséonaute" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCZ17ceLrs__ZzLwx8IrEFkw"/>
<outline text="" title="The Art Assignment" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCZ17ceLrs__ZzLwx8IrEFkw"/>
<outline text="" title="The Art Assignment" type="rss" xmlUrl="http://theartassignment.tumblr.com/rss/"/>
<outline text="" title="Mandala" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCWhNDgW-Dy8N9YQtJ5hqXIQ"/>
<outline text="" title="Les chroniques du dragon" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCwrSIvGrXBNDosRzLXL5-Fw"/>
<outline text="" title="Les trésors d’Arpheore" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC1YakKmeYcWwc2duhkBHLfw"/>
......@@ -188,7 +187,6 @@
<outline text="" title="Animétrage" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCQKBosbvkCSuNXcmk9wdl7w"/>
<outline text="" title="Confessons un film" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=LokiJackal"/>
<outline text="" title="God Awful Movies" type="rss" xmlUrl="http://godawfulmovies.libsyn.com/rss"/>
<outline text="" title="God Awful Movies" type="rss" xmlUrl="http://godawfulmovies.libsyn.com/rss"/>
<outline text="" title="Atheists Watch" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?user=TheBibleReloaded"/>
<outline text="" title="Atheists Watch" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UC1gSxXwxoIxIt9doAapuueg"/>
<outline text="" title="Mange tes navets" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCN8jtQ5bmkCVCES81VckKBQ"/>
......
......@@ -3,18 +3,19 @@
# Imports ===============================================================#
import os
import sys
import xml.etree.ElementTree as ET
# Programme =============================================================#
# Fonctions =============================================================#
def parse(xml_file):
def get_datas(xml_file):
def _parse_emission(emissions, main_elem):
def _parse_emission(data,node):
e = {"title": None, "urls": []}
for elem in main_elem:
for elem in node:
if elem.tag == "title":
e["title"] = elem.text
......@@ -24,70 +25,78 @@ def get_datas(xml_file):
if link.tag == "url":
rss_url = False
url_type, url_subtype = False,False
text = link.text
if "type" in link.attrib.keys():
url_type = link.attrib["type"]
else:
url_type = False
if "subType" in link.attrib.keys():
url_subtype = link.attrib["subType"]
else:
url_subtype = False
if url_type:
if url_type == "rss":
e["urls"].append(text)
rss_url = text
if url_type == "web":
if "rssUrl" in link.attrib.keys():
e["urls"].append(
"{0}{1}".format(
text, link.attrib["rssUrl"]
)
)
rss_url = "{0}{1}".format(text, link.attrib["rssUrl"])
if url_type == "yt":
if url_subtype in ["user", "channel"]:
ref = {
"user": "https://www.youtube.com/feeds/videos.xml?user=",
"channel": "https://www.youtube.com/feeds/videos.xml?channel_id="
}
e["urls"].append("{0}{1}".format(
ref[url_subtype], text
)
)
if len(e["urls"]) > 0:
emissions.append(e)
rss_url = "{}{}".format(ref[url_subtype],text)
if rss_url:
if not rss_url in e["urls"]:
e["urls"].append(rss_url)
if e["urls"]:
data["emissions"].append(e)
return data
def _main(xml_file):
data = {"update":None,"emissions":[]}
xml_parsed = ET.parse(xml_file)
xml_root = xml_parsed.getroot()
return emissions
for topElement in xml_root:
if topElement.tag == "update":
data["update"] = topElement.text
xml_parsed = ET.parse(xml_file)
xml_root = xml_parsed.getroot()
if topElement.tag == "category":
emissions = []
update = None
for subElem in topElement:
for supElem in xml_root:
if supElem.tag == "update":
update = supElem.text
if subElem.tag == "emission":
data = _parse_emission(data, subElem)
if supElem.tag == "category":
if subElem.tag == "subCategory":
for subElem in supElem:
if subElem.tag == "emission":
emissions = _parse_emission(emissions, subElem)
for em in subElem:
if subElem.tag == "subCategory":
for elem in subElem:
if elem.tag == "emission":
emissions = _parse_emission(emissions, elem)
if em.tag == "emission":
data = _parse_emission(data, em)
return {"update": update, "emissions": emissions}
return data
return _main(xml_file)
def write_opml(datas):
def write_opml(data,opml_file):
global ADDED_URLS
def _get_emission_text(emission):
......@@ -120,35 +129,67 @@ def write_opml(datas):
title, url
)
if datas:
with open("reco.opml", "w") as opmlf:
if data:
with open(opml_file, "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(' <title>Recommandations d\'émissions</title>\n')
if datas["update"] is not None:
if data["update"] is not None:
opmlf.write(
' <dateCreated>{0}</dateCreated>\n'.format(
datas["update"]
data["update"]
)
)
opmlf.write('</head>\n')
opmlf.write('<body>\n')
for emission in datas["emissions"]:
for emission in data["emissions"]:
opmlf.write(_get_emission_text(emission))
opmlf.write('</body>\n')
opmlf.write('</opml>\n')
return True
else:
return False
# Programme =============================================================#
if __name__ == "__main__":
# XML ->
if sys.argv[-1].endswith(".xml"):
xml_file = os.path.realpath(sys.argv[-1])
else:
xml_file = "reco.xml"
data = parse(xml_file)
# -> OPML
opml_file = [i for i in sys.argv if i.endswith(".opml")]
if opml_file:
if len(opml_file) > 1:
pass
else:
opml_file = opml_file[0]
else:
opml_file = "reco.opml"
ADDED_URLS = []
datas = get_datas("reco.xml")
write_opml(datas)
sys.exit(0)
success = write_opml(data,opml_file)
if success:
sys.exit(0)
else:
sys.exit(1)
# 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