/arduino-twitter-api

Library for using the twitter api directly on an esp8266 using the Arduino IDE

Primary LanguageC++GNU General Public License v2.0GPL-2.0

arduino-twitter-api

A wrapper for the Twitter API for Arduino (works on ESP8266)

WORK IN PROGRESS - API call works if you set the bearer token directly. It should be able to generate the bearer Credentials from the consumer key and secret and make a request to get the token but its not working at the moment.

In the api FAQ twitter mentions that they do not expire bearer tokens, so once you do not generate a new one with the same Credentials it should continue working

Getting API Key & Secret

  • Go to the following URL - sign in if you havent already.
  • Fill in the fields, For website you can enter any webpage (e.g. http://google.com), and create your app
  • Then click on the Keys & Tokens tab. Your Consumer Key and Consumer Secret will be there.

Getting Bearer Token

I am hoping to make this a little more simple going forward, as we should be able to do this on the board directly, but here they are for now :)

  • Get curl on your machine (Windows: try this it shoud already be installed on mac and linux)
  • Make the following request using the key and token from the above section
curl -u "CONSUMER_KEY:CONSUMER_SECRET" --data 'grant_type=client_credentials' 'https://api.twitter.com/oauth2/token'
  • The response will contain a bearer token (it is the big long one!), use this with the setBearerToken as shown in the example.