Twitter doubt

Hi,

Is twitter working with corona? I’m trying to post a tweet with my score but i can’t do it. There is some way to doing it? Or isn’t working??

Anyone is using it?

Thank you [import]uid: 105206 topic_id: 28993 reply_id: 328993[/import]

Yup Twitter is working fine for me - it’s quite a complicated process of getting an oAuth token and stripping that away to use. The code in the Sample Apps got me through it all however. [import]uid: 33275 topic_id: 28993 reply_id: 116696[/import]

I’m having this error:
{“error”:“Could not authenticate you.”,“request”:"/1/statuses/update.json"}

Some idea of why? [import]uid: 105206 topic_id: 28993 reply_id: 116717[/import]

Im using a table that i found on a tutorial, but im not shure if this works ok

[code]
local authorize_response = responseToTable(url, {"=", “&”})
local access_response = responseToTable(oAuth.getAccessToken(authorize_response.oauth_token, authorize_response.oauth_verifier, twitter_request_token_secret, consumer_key, consumer_secret, “https://api.twitter.com/oauth/access_token”), {"=", “&”})

access_token = access_response.oauth_token
access_token_secret = access_response.oauth_token_secret
user_id = access_response.user_id
screen_name = access_response.screen_name
function responseToTable(str, delimeters)
local obj = {}

while str:find(delimeters[1]) ~= nil do
if #delimeters > 1 then
local key_index = 1
local val_index = str:find(delimeters[1])
local key = str:sub(key_index, val_index - 1)

str = str:sub((val_index + delimeters[1]:len()))

local end_index
local value

if str:find(delimeters[2]) == nil then
end_index = str:len()
value = str
else
end_index = str:find(delimeters[2])
value = str:sub(1, (end_index - 1))
str = str:sub((end_index + delimeters[2]:len()), str:len())
end
obj[key] = value
print(key … “:” … value)
else

local val_index = str:find(delimeters[1])
str = str:sub((val_index + delimeters[1]:len()))

local end_index
local value

if str:find(delimeters[1]) == nil then
end_index = str:len()
value = str
else
end_index = str:find(delimeters[1])
value = str:sub(1, (end_index - 1))
str = str:sub(end_index, str:len())
end
obj[#obj + 1] = value
print(value)
end
end
return obj
end[code] [import]uid: 105206 topic_id: 28993 reply_id: 116719[/import]

I’d recommend looking at the Twitter sample app in the Sample Code. [import]uid: 33275 topic_id: 28993 reply_id: 116725[/import]

My problem is that when i request the access_token and the access_token_secret it gave me nil.
So, what i have to do is to specificate them

Example:
access_token = d82he8suq02u382938rj
access_token_secret = dj39485jf82jeji2938jfweieuw93ijfj*h827h

I think this is not a good solution.
Why are they nil?

Thank you [import]uid: 105206 topic_id: 28993 reply_id: 116734[/import]

Did you specific a call back URL when you set the app up with Twitter?
[import]uid: 19626 topic_id: 28993 reply_id: 116755[/import]

hi nml. Try this!
You wrote,
Example:
access_token = d82he8suq02u382938rj
access_token_secret = dj39485jf82jeji2938jfweieuw93ijfj*h827h

Is that the key you receive via Twitter website? Then you should put that as your consumer_key and consumer_secret instead. Like these

consumer_key = “d82he8suq02u382938rj” – key string goes here
consumer_secret = “dj39485jf82jeji2938jfweieuw93ijfj*h827h” – secret string goes here

Remember, it should be a string “”. And place them before your code.

[import]uid: 74883 topic_id: 28993 reply_id: 116779[/import]

Hi robmiracle, i did it, although i don’t understand for what is it used for.

Hi Burhan, i had the consumer_key and the consumer_secret specified too. But if i do not specify the access_token and access_token_secret it not works.

Thank you [import]uid: 105206 topic_id: 28993 reply_id: 116823[/import]