From f4f973cd6280ff55d671f8e48959d20a99d20e0d Mon Sep 17 00:00:00 2001 From: Thomas L Date: Sun, 25 Jun 2017 16:47:08 +0200 Subject: [PATCH 1/2] cleanup --- last_rt | 0 ticketfrei.cfg.example | 2 -- 2 files changed, 2 deletions(-) delete mode 100644 last_rt diff --git a/last_rt b/last_rt deleted file mode 100644 index e69de29..0000000 diff --git a/ticketfrei.cfg.example b/ticketfrei.cfg.example index e9277f7..9350cde 100644 --- a/ticketfrei.cfg.example +++ b/ticketfrei.cfg.example @@ -1,4 +1,3 @@ - [mapp] app_name = 'yourcity_ticketfrei' @@ -22,4 +21,3 @@ zu spät [blacklist] insult slur - From 897aabe16f29eae85159191ac8873e160894c6ed Mon Sep 17 00:00:00 2001 From: Thomas L Date: Sun, 25 Jun 2017 17:50:03 +0200 Subject: [PATCH 2/2] add filter to RetootBot --- retootbot.py | 6 ++++-- ticketfrei.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/retootbot.py b/retootbot.py index ca0a110..b9530fb 100644 --- a/retootbot.py +++ b/retootbot.py @@ -9,8 +9,9 @@ import time class RetootBot(object): - def __init__(self, config): + def __init__(self, config, filter): self.config = config + self.filter = filter self.register() self.login() @@ -54,7 +55,8 @@ class RetootBot(object): retoots = [] for notification in self.m.notifications(): if (notification['type'] == 'mention' - and notification['status']['id'] not in self.seen_toots): + and notification['status']['id'] not in self.seen_toots + and self.filter.check_string(notification['status']['content'])): print('Boosting toot %d from %s: %s' % ( notification['status']['id'], notification['status']['account']['acct'], diff --git a/ticketfrei.py b/ticketfrei.py index 5319b78..b0d7a8f 100644 --- a/ticketfrei.py +++ b/ticketfrei.py @@ -13,7 +13,7 @@ if __name__ == '__main__': trigger = Trigger(config) - mbot = RetootBot(config) + mbot = RetootBot(config, trigger) tbot = RetweetBot(trigger) try: