Explorar el Código

fixing RT line in tweets, adding source for tweets

master
Andreas Demmelbauer hace 6 años
padre
commit
5f134c0a24
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. +3
    -3
      tootbot.py

+ 3
- 3
tootbot.py Ver fichero

@@ -112,9 +112,8 @@ for p in reversed(t.entries):
mastodon_api = register_app(mastuser, mastpasswd, mastinstance, mastodon_api)

c = p.title

if p.author != '(%s)' % twitteruser:
c = ("RT %s\n" % p.author[1:-1]) + c
if p.author.lower() != '(@%s)' % twitteruser.lower():
c = ("RT %s from Twitter:\n" % p.author[1:-1]) + c
toot_media = []
# get the pictures...
for pic in re.finditer(r"https://pbs.twimg.com/[^ \xa0\"]*", p.summary):
@@ -142,6 +141,7 @@ for p in reversed(t.entries):

# remove ellipsis
c = c.replace('\xa0…',' ')
c += '\n\nSource: %s' % p.link
print(c)

if (not dryrun):


Cargando…
Cancelar
Guardar