forked from ticketfrei/ticketfrei
clean up after refactor
This commit is contained in:
parent
21f1e9ddb3
commit
b51449a70a
|
@ -26,10 +26,9 @@ class MastodonBot(Bot):
|
||||||
return mentions
|
return mentions
|
||||||
for status in notifications:
|
for status in notifications:
|
||||||
if (status['type'] == 'mention' and
|
if (status['type'] == 'mention' and
|
||||||
status['status']['id'] > self.seen_toots):
|
status['status']['id'] > user.get_seen_toot()):
|
||||||
# save state
|
# save state
|
||||||
self.seen_toots = status['status']['id']
|
user.save_seen_toot(status['status']['id'])
|
||||||
self.save_last()
|
|
||||||
# add mention to mentions
|
# add mention to mentions
|
||||||
text = re.sub(r'<[^>]*>', '', status['status']['content'])
|
text = re.sub(r'<[^>]*>', '', status['status']['content'])
|
||||||
text = re.sub(
|
text = re.sub(
|
||||||
|
|
|
@ -33,7 +33,7 @@ if __name__ == '__main__':
|
||||||
time.sleep(60) # twitter rate limit >.<
|
time.sleep(60) # twitter rate limit >.<
|
||||||
except:
|
except:
|
||||||
logger.error('Shutdown', exc_info=True)
|
logger.error('Shutdown', exc_info=True)
|
||||||
mailer = sendmail.Mailer(config)
|
mailer = sendmail.Mailer()
|
||||||
try:
|
try:
|
||||||
mailer.send('', config['web']['contact'],
|
mailer.send('', config['web']['contact'],
|
||||||
'Ticketfrei Crash Report',
|
'Ticketfrei Crash Report',
|
||||||
|
|
4
bot.py
4
bot.py
|
@ -1,8 +1,8 @@
|
||||||
class Bot(object):
|
class Bot(object):
|
||||||
# returns a list of Report objects
|
# returns a list of Report objects
|
||||||
def crawl(user):
|
def crawl(self, user):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# post/boost Report object
|
# post/boost Report object
|
||||||
def post(user, report):
|
def post(self, user, report):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -8,6 +8,7 @@ Students: usually already have a ticket, but may be solidaric
|
||||||
Leftist scene
|
Leftist scene
|
||||||
* Flyers in alternative centers
|
* Flyers in alternative centers
|
||||||
* Graffitis in alternative neighbourhoods
|
* Graffitis in alternative neighbourhoods
|
||||||
|
* Posters in social centers
|
||||||
|
|
||||||
Schools:
|
Schools:
|
||||||
* especially trade schools
|
* especially trade schools
|
||||||
|
|
Loading…
Reference in a new issue