Commit faff181c authored by Mindiell's avatar Mindiell

Text to tweet modified

parent be0891d5
...@@ -83,8 +83,11 @@ Utilisations: ...@@ -83,8 +83,11 @@ Utilisations:
"topic": "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.""", """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": "tweet_rp_fr":
"""[La Quadrature du Net - Revue de presse] %s — %s""", """[fr] %s — %s""",
"tweet_rp_en":
"""[en] %s — %s""",
"reload": "reload":
"""Configuration à jour""", #La configuration a été mise à jour, merci <3""", """Configuration à jour""", #La configuration a été mise à jour, merci <3""",
......
...@@ -446,6 +446,9 @@ class Wantzel(object): ...@@ -446,6 +446,9 @@ class Wantzel(object):
), ),
"%Y-%m-%d %Z" "%Y-%m-%d %Z"
) )
language = "fr"
if "/en/" in rss:
language = "en"
entries = feedparser.parse(rss)['entries'] entries = feedparser.parse(rss)['entries']
entries.reverse() entries.reverse()
for entry in entries: for entry in entries:
...@@ -453,7 +456,7 @@ class Wantzel(object): ...@@ -453,7 +456,7 @@ class Wantzel(object):
# lesser than future # lesser than future
if today < entry.published_parsed < now: if today < entry.published_parsed < now:
if self.last_entry_published < entry.published_parsed: 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.title.encode("utf-8"),
entry.link.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