added more letter sets and added code to move access tokens to new file
This commit is contained in:
parent
94cb5b16a4
commit
08015f7736
6
emgen.py
6
emgen.py
|
@ -3,15 +3,13 @@
|
|||
import random
|
||||
import sys
|
||||
|
||||
#Set this to your instance's supported letter sets
|
||||
prefix = ["8b", "archer", "hacker", "jhg", "lazer", "sans_l", "sans_u", "smb", "sm64", "tp", "wide" ]
|
||||
|
||||
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)
|
||||
|
@ -21,8 +19,6 @@ for letter in input:
|
|||
output += letter+"\u200b"
|
||||
elif rando == "lazer":
|
||||
output += ":"+rando+"_"+letter.upper()+u":\u200b"
|
||||
elif letter in ("\'", "\"", "?", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"):
|
||||
output += ":sm64_"+letter+u":\u200b"
|
||||
else:
|
||||
output += ":"+rando+"_"+letter.lower()+u":\u200b"
|
||||
|
||||
|
|
24
emtoot.py
24
emtoot.py
|
@ -1,36 +1,34 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
#Be sure to do 'pip3 install Mastodon.py' first
|
||||
from mastodon import Mastodon
|
||||
import random
|
||||
import sys
|
||||
import random, sys, json, os
|
||||
|
||||
with open(os.environ.get('HOME')+'/.config/mastodon-tokens.json') as json_data:
|
||||
apikey = json.load(json_data)
|
||||
|
||||
ident = "barkshark-izalia-emtoot"
|
||||
|
||||
# Create actual API instance
|
||||
mastodon = Mastodon(
|
||||
access_token='insert access token here',
|
||||
api_base_url='https://mastodon.barkshark.tk'
|
||||
access_token=apikey[ident]['token'],
|
||||
api_base_url=apikey[ident]['domain']
|
||||
)
|
||||
|
||||
#Set this to your instance's supported letter sets
|
||||
prefix = ["8b", "archer", "hacker", "jhg", "lazer", "sans_l", "sans_u", "smb", "sm64", "tp", "wide" ]
|
||||
|
||||
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
|
||||
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", language=None, idempotency_key=None)
|
||||
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)
|
||||
|
|
13
imgay.py
Normal file → Executable file
13
imgay.py
Normal file → Executable file
|
@ -1,13 +1,16 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# This literally just toots out "im gay"
|
||||
# Cron job used: 0 2,14 * * * /home/anna/.local/bin/imgay
|
||||
|
||||
from mastodon import Mastodon
|
||||
import json, os
|
||||
|
||||
with open(os.environ.get('HOME')+'/.config/mastodon-tokens.json') as json_data:
|
||||
apikey = json.load(json_data)
|
||||
|
||||
ident = "barkshark-izalia-imgay"
|
||||
|
||||
mastodon = Mastodon(
|
||||
access_token='INSERT ACCESS TOKEN HERE',
|
||||
api_base_url='INSERT YOUR INSTANCE\'S DOMAIN HERE'
|
||||
access_token=apikey[ident]['token'],
|
||||
api_base_url=apikey[ident]['domain']
|
||||
)
|
||||
|
||||
output="im gay"
|
||||
|
|
13
mastodon-tokens.json
Normal file
13
mastodon-tokens.json
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"domain1-example1":
|
||||
{
|
||||
"domain": "mastodon.barkshark.tk",
|
||||
"token": "access token goes here"
|
||||
},
|
||||
|
||||
"domain2-example1":
|
||||
{
|
||||
"domain": "botsin.space",
|
||||
"token": "access token goes here"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue