Twitter.class.nut -- the index 'http' does not exist (line 210)

Hi,

I am getting the following error upon running some sample Device code:

Error: 2015-09-07 20:26:07 UTC-7 [Device] the index ‘http’ does not exist (line 210)

Sample code:

#require "Twitter.class.nut:1.2.0"
twitter <- Twitter(“XXXXX”, “YYYYY”, “ZZZZZ”, “AAAA”)

try {

twitter.tweet("I just tweeted from an @electricimp agent - bit.ly/ei-twitter.")

} catch(error) {
server.error("Exception occured… ");
server.log(error);
}

Any help/pointers will be much appreciated.

Thanks!

You’re #require’ing it in the device side; as a cloud service interface it only works on the agent side.

Hi Hugo,

Thank you! Switching to Agent code resolved my issue. Does this apply to Twitter streaming API as well? Sorry, I am new to Electric Imp.

Yes, @iamontheinet, the Twitter code is exclusively for agents – the best place for it!

Great. Tx!