34 lines
1,001 B
Python
Executable file
34 lines
1,001 B
Python
Executable file
#!/usr/bin/env python3
|
|
from mastodon import Mastodon
|
|
import random, sys, json, os
|
|
|
|
apikey = json.load(open(os.environ.get('HOME')+'/.config/mastodon-tokens.json', 'r'))
|
|
|
|
ident = "barkshark-izalia-emoji"
|
|
|
|
mastodon = Mastodon(
|
|
access_token=apikey[ident]['token'],
|
|
api_base_url=apikey[ident]['domain']
|
|
)
|
|
|
|
input = ""
|
|
|
|
for t in sys.argv[1:]:
|
|
input += str(t + " ")
|
|
|
|
output = ""
|
|
prefix = ["8b", "archer", "hacker", "jhg", "lazer", "sans_l", "sans_u", "smb", "sm64", "tp", "wide" ]
|
|
for letter in input :
|
|
rando = random.choice(prefix)
|
|
if letter == " ":
|
|
output += u" :blank: \u200b"
|
|
elif not letter.isalpha():
|
|
output += letter+"\u200b"
|
|
elif rando == "lazer":
|
|
output += ":"+rando+"_"+letter.upper()+u":\u200b"
|
|
else:
|
|
output += ":"+rando+"_"+letter.lower()+u":\u200b"
|
|
#print(output)
|
|
|
|
mastodon.status_post(status=output, in_reply_to_id=None, media_ids=None, sensitive=False, visibility="public", spoiler_text="emoji spam uvu, possibly lewd", language=None, idempotency_key=None)
|