Browse Source

Updated for basic curation / timeline sniffing

bot_curator
KemoNine 4 years ago
parent
commit
dda63ff68a
  1. 8
      configs/example_curation_config.yaml
  2. 5
      toot_bot.py

8
configs/example_curation_config.yaml

@ -10,3 +10,11 @@ curation:
local: True
federated: True
cache_file: /home/mastodon/bot/curation_cache.db
purge_interval:
hours:
minutes:
seconds:
delay_interval:
hours:
minutes:
seconds:

5
toot_bot.py

@ -74,8 +74,9 @@ class CurationBot(StreamListener):
def on_delete(self, status_id):
'''A status has been deleted. status_id is the status' integer ID.'''
print('deleted: ' + str(status_id))
print(' this status should delete an entry from the cache')
# Remove the status from the toot_cache if we see a delete
self.cursor.execute('delete from toot_cache where toot_id = ?', (status_id,))
self.conn.commit()
def handle_heartbeat(self):
'''The server has sent us a keep-alive message. This callback may be

Loading…
Cancel
Save