Compare commits
No commits in common. "79038a0e000aefcb25dbcbe3aaf60d5141f162f8" and "96e575edba5dfe5fb2f3e66b91ea004c1d8e8279" have entirely different histories.
79038a0e00
...
96e575edba
2 changed files with 2 additions and 4 deletions
2
login.py
2
login.py
|
@ -2,7 +2,7 @@
|
|||
import json
|
||||
from mastodon import Mastodon
|
||||
|
||||
scopes = ["read:statuses", "read:accounts", "read:follows", "write:statuses", "read:notifications"]
|
||||
scopes = ["read:statuses", "read:accounts", "read:follows", "write:statuses"]
|
||||
cfg = json.load(open('config.json', 'r'))
|
||||
|
||||
if "client" not in cfg:
|
||||
|
|
4
main.py
4
main.py
|
@ -61,13 +61,11 @@ 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, spoiler_text = "Search result")
|
||||
client.status_post(toot, post_id, visibility=visibility)
|
||||
print("replied with " + toot)
|
||||
|
||||
rl = ReplyListener()
|
||||
|
|
Loading…
Reference in a new issue