announce event-o-mat events
The credentials for the different services is the center-piece of the announcer. Without credentials not much will happen. Creds.json looks like this:
{
"mastodon": ... ,
"facebook": ...
...
}
The following subsections describe how you can get each token.
see shack_announce/autenticate.py
, you need:
{
"mastodon":{
"chaos.social": {
"client_id": "",
"client_secret": "",
"access_token": "",
"url": "https://chaos.social",
"visibility": "unlisted"
},
"botsin.space": {
"client_id": "",
"client_secret": "",
"access_token": "",
"url": "https://botsin.space",
"visibility": "public"
}
}
}
from mastodon import Mastodon
url = "https://botsin.space"
user = "your-email"
pw = "your-pass"
app = Mastodon.create_app( "shack-publisher", api_base_url=url )
mastodon = Mastodon(client_id=app[0],client_secret=app[1],api_base_url=url)
log = mastodon.log_in(user,pw)
print(json.dumps({
"client_id": app[0],
"client_secret": app[1],
"api_base_url": url,
"access_token": log
},indent=4))
- Create a new app (do not publish)
- Create short-lived access token for the page via the API explorer
- Create long-lived access token via the token debug page
- use the token in the api explorer to GET
/3.1/<PAGE-ID>?fields=access_token
copy the never-expiring token (check via token debug page)
{
"facebook": {
"access_token": "",
"groups": [ 122027937823921 ]
}
}
- Become developer with application at https://developer.twitter.com
- create new app, go to keys and tokens
- create all 4 token and secrets
"twitter": {
"consumer_key": "A",
"consumer_secret": "B",
"token_key": "C",
"token_secret": "D",
}