This guide assumes:
- You are familiar with JSON formatting
- You have read and understood the Alarm Configuration Wiki
- You are comfortable with the layout of
alarms.json
.
Please familiarize yourself with all of the above before proceeding.
Twitter is an online social networking service that enables users to send and read short 140-character messages called "tweets". Registered users can read and post tweets, but those who are unregistered can only read them. Users access Twitter through the website interface, SMS or mobile device app.
PokeAlarm offers the following for Twitter:
- Personalized notifications via Dynamic Text Substitution
These alarm.json
parameters are required to enable the Twitter alarm service:
Parameters | Description |
---|---|
type |
must be twitter |
active |
True for alarm to be active |
access_token |
Your twitter access token |
access_secret |
Your twitter access secret |
consumer_key |
Your twitter consumer key |
consumer_secret |
Your twitter consumer secret |
{
"active": "False",
"type": "twitter",
"access_token": "YOUR_ACCESS_TOKEN",
"access_secret": "YOUR_ACCESS_SECRET",
"consumer_key": "YOUR_CONSUMER_KEY",
"consumer_secret": "YOUR_CONSUMER_SECRET"
}
Note: The above code is to be inserted into the alarms section of alarms.json
. It does not represent the entire alarms.json
file.
In addition to the required parameters, several alarm.json
optional parameters are available to personalize your notifications. Below is an example of these optional parameters and how they are incorporated into a functional alarm layout.
These optional parameters, startup_message
, and startup_list
, are entered at the same level as "type":"twitter"
.
Parameters | Description | Default |
---|---|---|
startup_message |
Confirmation post when PokeAlarm initialized | True |
startup_list |
First post will list all alarmed pokemon enabled in alarms.json |
True |
These optional parameters below are applicable to the pokemon
, pokestop
, and gym
sections of the JSON file.
Parameters | Description | Default |
---|---|---|
status |
Message to post as status | A wild <pkmn> has appeared! Available until <24h_time> (<time_left>). <gmaps> |
{
"active": "False",
"type": "twitter",
"access_token": "YOUR_ACCESS_TOKEN",
"access_secret": "YOUR_ACCESS_SECRET",
"consumer_key": "YOUR_CONSUMER_KEY",
"consumer_secret": "YOUR_CONSUMER_SECRET",
"pokemon":{
"status": "A wild <pkmn> has appeared! Available until <24h_time> (<time_left>). <gmaps>"
},
"pokestop":{
"status": "Someone has placed a lure on a Pokestop! Lure will expire at <24h_time> (<time_left>). <gmaps>"
},
"gym":{
"status":"A Team <old_team> gym has fallen! It is now controlled by <new_team>. <gmaps>"
}
}
Note: The above code is to be inserted into the alarms section of alarms.json
. It does not represent the entire alarms.json
file.
For more information on text substitutions, please see the main configuration page.
- Go to Twitter's signup page
- Fill out all details, and make sure to include your phone number. This is a requirement for remote access, and you will need that to make the Twitter bot work.
- Go to app.twitter.com
- Click 'Create New App' button
- Fill out the details on the form. You have to give your app a name, description, and website. This can be a simple place holder like http://www.example.com
- Read the Developer Agreement, and check the box at the bottom if you agree. Then click on the ‘Create your Twitter application’ button.
- After creating your new app, you were redirected to its own page. If you weren’t, go to apps.twitter.com and click on your apps name.
- On the app’s page, click on the ‘Keys and Access Tokens’ page.
- At the bottom of this page, click on the ‘Create my access token’ button.
- Take note of Consumer Key (API Key), Consumer Secret (API Secret), Access Token, & Access Token Secret. These are the are required in the Twitter Config.