Compare commits

...

2 Commits

Author SHA1 Message Date
Lynne Megido 79038a0e00 don't @ people 2019-05-11 02:47:04 +10:00
Lynne Megido e03e2ad4b5 add cw, request notif permission 2019-05-11 02:45:27 +10:00
2 changed files with 4 additions and 2 deletions

View File

@ -2,7 +2,7 @@
import json
from mastodon import Mastodon
scopes = ["read:statuses", "read:accounts", "read:follows", "write:statuses"]
scopes = ["read:statuses", "read:accounts", "read:follows", "write:statuses", "read:notifications"]
cfg = json.load(open('config.json', 'r'))
if "client" not in cfg:

View File

@ -61,11 +61,13 @@ class ReplyListener(mastodon.StreamListener):
result = j['results'][0]
toot = result['title'] + "\n" + result['url'] + "\n" + result['content'] + "\n" + "(Score: {})\nMore results: {}{}".format(result['score'], "https://searx.lynnesbian.space/?q=", q.replace(" ", "%20"))
toot = toot.replace("@", "@\u200B") # don't @ people
toot = acct + " " + toot
visibility = notification['status']['visibility']
if visibility == "public":
visibility = "unlisted"
client.status_post(toot, post_id, visibility=visibility)
client.status_post(toot, post_id, visibility=visibility, spoiler_text = "Search result")
print("replied with " + toot)
rl = ReplyListener()