Commit faff181c authored by Mindiell's avatar Mindiell

Text to tweet modified

parent be0891d5
......@@ -83,8 +83,11 @@ Utilisations:
"topic":
"""Canal de la revue de presse de La Quadrature du Net ~ %s articles en attente ~ Mode d'emploi https://wiki.laquadrature.net/Revue_de_presse ~ Une arme, le savoir est. Le diffuser, notre devoir c'est.""",
"tweet_rp":
"""[La Quadrature du Net - Revue de presse] %s — %s""",
"tweet_rp_fr":
"""[fr] %s — %s""",
"tweet_rp_en":
"""[en] %s — %s""",
"reload":
"""Configuration à jour""", #La configuration a été mise à jour, merci <3""",
......
......@@ -446,6 +446,9 @@ class Wantzel(object):
),
"%Y-%m-%d %Z"
)
language = "fr"
if "/en/" in rss:
language = "en"
entries = feedparser.parse(rss)['entries']
entries.reverse()
for entry in entries:
......@@ -453,7 +456,7 @@ class Wantzel(object):
# lesser than future
if today < entry.published_parsed < now:
if self.last_entry_published < entry.published_parsed:
self.tweet(messages["tweet_rp"] % (
self.tweet(messages["tweet_rp_%s" % language] % (
entry.title.encode("utf-8"),
entry.link.encode("utf-8")
))
......
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