0

token issue with twitter in yahoo example

I have one issue at the moment


http://developer.yahoo.net/blog/archives/2...tterstatus.html
for step C in the webpage you presented above I have an issue,

c. Tweet something:
INSERT INTO twitter.status (status, oauth_consumer_key, oauth_consumer_secret, oauth_token, oauth_token_secret)
VALUES ('tweeting from yql!', '@your_consumer_key', '@your_consumer_secret', '@your_access_token', '@your_access_secret');

When I look at the provided keys for my application, i see a consumer key and a consumer secret, but I dont see an oauth token or oauth token secret

I see a request token url, and an access token url and an authorize url
Request token URL
https://twitter.com/oauth/request_token
Access token URL
https://twitter.com/oauth/access_token
Authorize URL
https://twitter.com/oauth/authorize

which of these url's do I put? twitter did not provide me with an access token and access secret, unless these url's are to be put there, which I do not think is right?

INSERT INTO twitter.status (status, oauth_consumer_key, oauth_consumer_secret, oauth_token, oauth_token_secret)
VALUES ('tweeting from yql!', 'MY KEY', 'MY SECRET', 'https://twitter.com/oauth/access_token', 'https://twitter.com/oauth/authorize');

I obviously did something wrong because I received an unauthorized error, and I expected as such, I thought the oauth token and secret are variables, but how do I get those variables in the yql process?

thanks in advance:)

by
13 Replies
  • QUOTE (Houyhnhnm @ Aug 11 2010, 12:33 PM) <{POST_SNAPBACK}>
    c. Tweet something:
    INSERT INTO twitter.status (status, oauth_consumer_key, oauth_consumer_secret, oauth_token, oauth_token_secret)
    VALUES ('tweeting from yql!', '@your_consumer_key', '@your_consumer_secret', '@your_access_token', '@your_access_secret');

    When I look at the provided keys for my application, i see a consumer key and a consumer secret, but I dont see an oauth token or oauth token secret


    OAuth access is a 3 step dance. The link below talks about the flow.

    http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html

    What you need to do is use consumer key and consumer secret and authorize yourself and trade it for an access token and an access token secret. Once you have this, you will be able to use the twitter table.

    For the oauth twitter access, there are two tables called twitter.oauth.requesttoken and twitter.oauth.accesstoken. With this you will be able to get the access token / secret. These tables should be self explanatory but if you need any additional help post back.

    HTH
    -balaji
    0
  • QUOTE (Balaji Narayanan @ Aug 13 2010, 10:40 AM) <{POST_SNAPBACK}>
    OAuth access is a 3 step dance. The link below talks about the flow.

    http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html

    What you need to do is use consumer key and consumer secret and authorize yourself and trade it for an access token and an access token secret. Once you have this, you will be able to use the twitter table.

    For the oauth twitter access, there are two tables called twitter.oauth.requesttoken and twitter.oauth.accesstoken. With this you will be able to get the access token / secret. These tables should be self explanatory but if you need any additional help post back.

    HTH
    -balaji



    The Oauth Verifier for the twitter.oauth,accesstoken table, I recognize that a user must enter it in the process. But, I wanted to just test out the tables in the yql console.
    Is it possible to get the oauth verifier from the yql console or are the twitter tables designed not to work in the console.

    Using request token I receive the token and token secret with my consumer key and consumer secret, but for the accesstoken table, I was unable to figure out what the oauth verifier is.
    At a point I thought it would be oob , but that didn't work.

    Is it possible to use the requesttoken, accestoken, twitterstatus tables in that sequence, while in the yql console?

    also twitter asks, does the application run in a web browser or desktop client?
    tell me, for working in the yql console which is the correct one if it matters, and why?
    I recognize browser would be best for my app in the future as it will be accessible through browsers.
    0
  • QUOTE (Houyhnhnm @ Aug 13 2010, 07:19 PM) <{POST_SNAPBACK}>
    The Oauth Verifier for the twitter.oauth,accesstoken table, I recognize that a user must enter it in the process. But, I wanted to just test out the tables in the yql console.
    Is it possible to get the oauth verifier from the yql console or are the twitter tables designed not to work in the console.


    Yes it is possible. See below

    QUOTE
    Using request token I receive the token and token secret with my consumer key and consumer secret, but for the accesstoken table, I was unable to figure out what the oauth verifier is.
    At a point I thought it would be oob , but that didn't work.

    Is it possible to use the requesttoken, accestoken, twitterstatus tables in that sequence, while in the yql console?


    Yes. That is exactly the process that needs to follows. If you use the request token table, you would get a request token and request secret. Once you have this, visit https://api.twitter.com/oauth/authorize? along with the response you received from the YQL request.

    Twitter will ask you for the authorization and will return you a verfier.

    Call the twitter.oauth.accesstoken with your keys along with the verfier that you recieved from twitter. You will receive an access token and an access token secret in response. Voila, you can make any oauth calls after this.

    QUOTE
    also twitter asks, does the application run in a web browser or desktop client?
    tell me, for working in the yql console which is the correct one if it matters, and why?
    I recognize browser would be best for my app in the future as it will be accessible through browsers.


    You can use the browser but for testing with yql, when yql calls the request token, it will set callback to oob (out of bounds) for this specific case.

    HTH
    -balaji
    0
  • QUOTE (Balaji Narayanan @ Aug 13 2010, 09:07 PM) <{POST_SNAPBACK}>
    Yes it is possible. See below



    Yes. That is exactly the process that needs to follows. If you use the request token table, you would get a request token and request secret. Once you have this, visit https://api.twitter.com/oauth/authorize? along with the response you received from the YQL request.

    Twitter will ask you for the authorization and will return you a verfier.

    Call the twitter.oauth.accesstoken with your keys along with the verfier that you recieved from twitter. You will receive an access token and an access token secret in response. Voila, you can make any oauth calls after this.



    You can use the browser but for testing with yql, when yql calls the request token, it will set callback to oob (out of bounds) for this specific case.

    HTH
    -balaji



    First, let me say, thank you for all the help.
    I have the process up to a point.

    using insert for the twitter.status table, I receive

    response
    <url execution-time="182" http-status-code="401"
    http-status-message="Unauthorized" proxy="DEFAULT"><![CDATA[http://api.twitter.com/1/statuses/update.xml]]></url>
    <javascript execution-time="606" instructions-used="1131137" table-name="twitter.status"/>

    I used
    INSERT INTO twitter.status (status, oauth_consumer_key, oauth_consumer_secret, oauth_token, oauth_token_secret)
    VALUES ('tweeting from yql!', 'MY APP CONSUMER KEY', 'MY APP CONSUMER SECRET', 'THE OAUTH TOKEN RETURNED FROM THE TWITTER.OAUTH.ACCESSTOKEN TABLE', 'THE OAUTH TOKEN SECRET RETURNED FROM THE TWITTER.OAUTH.ACCESSTOKEN TABLE')

    I used the oauth token and oauth token secret from the request token table in the accesstoken and used the oauth token and oauth token secret from the access token table to get a new oauth token and oauth token secret, but using the insert, with these relevant values, I get the 401 status code response.

    I went over the steps again and tried it with different accounts to make sure. What could be the problem?
    0
  • QUOTE (Houyhnhnm @ Aug 15 2010, 11:19 PM) <{POST_SNAPBACK}>
    First, let me say, thank you for all the help.
    I have the process up to a point.

    using insert for the twitter.status table, I receive

    response
    <url execution-time="182" http-status-code="401"
    http-status-message="Unauthorized" proxy="DEFAULT"><![CDATA[http://api.twitter.com/1/statuses/update.xml]]></url>
    <javascript execution-time="606" instructions-used="1131137" table-name="twitter.status"/>

    I used
    INSERT INTO twitter.status (status, oauth_consumer_key, oauth_consumer_secret, oauth_token, oauth_token_secret)
    VALUES ('tweeting from yql!', 'MY APP CONSUMER KEY', 'MY APP CONSUMER SECRET', 'THE OAUTH TOKEN RETURNED FROM THE TWITTER.OAUTH.ACCESSTOKEN TABLE', 'THE OAUTH TOKEN SECRET RETURNED FROM THE TWITTER.OAUTH.ACCESSTOKEN TABLE')

    I used the oauth token and oauth token secret from the request token table in the accesstoken and used the oauth token and oauth token secret from the access token table to get a new oauth token and oauth token secret, but using the insert, with these relevant values, I get the 401 status code response.

    I went over the steps again and tried it with different accounts to make sure. What could be the problem?


    I also tested the same and this is giving a signature invalid message. I will ask around to see if anyone knows this issue.
    0
  • QUOTE (Balaji Narayanan @ Aug 16 2010, 08:49 PM) <{POST_SNAPBACK}>
    I also tested the same and this is giving a signature invalid message. I will ask around to see if anyone knows this issue.


    thanks:) regardless though, I finally have the oauth understood, so this is worth it nonetheless
    0
  • QUOTE (Balaji Narayanan @ Aug 16 2010, 08:49 PM) <{POST_SNAPBACK}>
    I also tested the same and this is giving a signature invalid message. I will ask around to see if anyone knows this issue.


    oh and please , if you find anything or get any report, to add the knowledge to this stream
    thank you again
    0
  • QUOTE (Houyhnhnm @ Aug 17 2010, 05:42 AM) <{POST_SNAPBACK}>
    oh and please , if you find anything or get any report, to add the knowledge to this stream
    thank you again


    Here is a work around that I have got working. Test it out. I will ask the original author to see if this is okay to get it pushed to github.

    CODE
    use 'http://balajin.net/hacks/yql/twitter.status.xml' as twitter.status; insert nto twitter.status ....
    0
  • QUOTE (Balaji Narayanan @ Aug 17 2010, 08:12 AM) <{POST_SNAPBACK}>
    Here is a work around that I have got working. Test it out. I will ask the original author to see if this is okay to get it pushed to github.

    CODE
    use 'http://balajin.net/hacks/yql/twitter.status.xml' as twitter.status; insert nto twitter.status ....


    It sent me back this, hope this helps in the fixing

    <javascript execution-time="648" instructions-used="1134108" table-name="twitter.status"/>
    <javascript name="twitter.status" verb="insert"><![CDATA[No Context associated with current Thread]]></javascript>
    <user-time>1098</user-time>

    I simply appended your use in front of my insert instruction. Is their more specifics that I need. I tried it to make sure it is syntactically correct, it seems so.
    0
  • QUOTE (Houyhnhnm @ Aug 19 2010, 09:25 PM) <{POST_SNAPBACK}>
    It sent me back this, hope this helps in the fixing

    <javascript execution-time="648" instructions-used="1134108" table-name="twitter.status"/>
    <javascript name="twitter.status" verb="insert"><![CDATA[No Context associated with current Thread]]></javascript>
    <user-time>1098</user-time>

    I simply appended your use in front of my insert instruction. Is their more specifics that I need. I tried it to make sure it is syntactically correct, it seems so.


    My bad, it should be working now. there was a bug in the custom table that i had built.

    Sorry for the delayed response, I was stuck with some work and did not have the time to look at it.

    HTH
    -balaji
    0
  • FYI, The tables on datatables.org, and the twitter insert should function without any additional changes. So go ahead and test it out.

    Cheers
    -balaji
    0
  • Hi,
    I've tried using those queries above.. which consumer key and secret should i use? from yahoo api or twitter api? i've tried using both, but no success top insert value. Please guide.. thanks


    QUOTE (Balaji Narayanan @ Sep 15 2010, 08:31 PM) <{POST_SNAPBACK}>
    FYI, The tables on datatables.org, and the twitter insert should function without any additional changes. So go ahead and test it out.

    Cheers
    -balaji
    0
  • QUOTE (muck @ Oct 10 2010, 11:27 PM) <{POST_SNAPBACK}>
    Hi,
    I've tried using those queries above.. which consumer key and secret should i use? from yahoo api or twitter api? i've tried using both, but no success top insert value. Please guide.. thanks


    If you are using the twitter table, you will need to use the consumer key and consumer secret obtained from twitter.

    -balaji
    0

Recent Posts

in YQL