Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By AndyGadget
#37965 Hey, I'm a hardware guy not a softie so don't expect a logical reasoned approach here, but I've been trying to post a message from ESP8266Basic to Twitter via ThingSpeak. Success was mainly a case of looking at existing examples from various forums and quite a bit of trial and error until I had the satisfaction of my Tweet appearing.
You will need to set up the ThingSpeak 'thingtweet' control and link to a Twitter account to get an API key for transfers. I haven't had a lot of time to play with this, but the Twitter account I've set up is ArmyOfThings.
This is the most basic code which worked and there's plenty of scope for experimentation and improvement here.

Code: Select allTOP
cls
Textbox MyData
button "Click to send " [postit]
wait
'
[postit]
OPString = "api.thingspeak.com/apps/thingtweet/1/statuses/update?api_key={my API key}&status=" & MyData
print wget(OPString)
wait
goto TOP