Post to twitter

Which is the best way for a Corona app to post tweets in twitter.

I tried Peach’s
http://techority.com/2011/05/26/post-to-twitter-from-your-application/
but it just kept flashing the login screen before closing.
(admittedly the tutorial was for iOS and my device is Android…still…)

Then I tried the sample code provided by Anscahttp://developer.anscamobile.com/content/twitter It is supposed to work but it didn’t work for me… just said “your tweet is posted”… but no tweet got posted.

So anyone got a better idea… Or is one of the above supposed to work and I am doing something wrong? Any help is appreciated [import]uid: 64174 topic_id: 19033 reply_id: 319033[/import]

Try this–it’s code I got somewhere else in the forum:

[lua]-- Function for URLencoding of message content
local function escape (s)
s = string.gsub(s, “([&=+%c])”, function ©
return string.format("%%%02X", string.byte©)
end)
s = string.gsub(s, " ", “+”)
return s
end

local tweetText = “This is the tweet message.”

local postBody = escape( tweetText )
local theNetwork = theNetwork or “twitter” – twitter is default

–local theString = string.gsub(message, “( )”, “%%20”)
if theNetwork == theNetwork or “twitter” then
native.showWebPopup(20, 20, display.contentWidth - 40, display.contentHeight - 90, “http://twitter.com/intent/tweet?text=”…postBody)
end[/lua] [import]uid: 40033 topic_id: 19033 reply_id: 73399[/import]

Thanks a lot man! guess I was trying too much to do such a simple thing! :slight_smile:
Just one question… Is it possible to detect if the tweet has been posted? Like what happens in facebook api, where some event is fired on logging in… [import]uid: 64174 topic_id: 19033 reply_id: 73406[/import]

This returns “Your Tweet has been posted! View it on Twitter”. It works for me (verified that it posted). [import]uid: 40033 topic_id: 19033 reply_id: 73408[/import]

No! I meant verify programmatically! can I inform my game somehow that the tweet was successfully posted? [import]uid: 64174 topic_id: 19033 reply_id: 73411[/import]