{"errors": [{ "message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}
This causes our example to fail with...
atagar@morrigan:~/Desktop/stem$ python twitter_script Traceback (most recent call last): File "twitter_script", line 39, in <module> print "%i. %s" % (index + 1, tweet["created_at"])TypeError: string indices must be integers
Patches welcome for migrating the example to the 1.1 API!
Trac: Username: ovnicraft
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
Hi ovnicraft, that tutorial is failing for you because tor is talking a really long time to start up (so stem is timing out). Please try the first client usage tutorial - that will print out the bootstrap messages so we'll get a better idea of what it's getting hung up on.
So with Read Twitter they has deprecated api v1, now they recommend use 1.1.
I was reading about changes in API and twitter forces auth to all requests maybe tutorial needs some update about it or got how to make requests to twitter w/o authentification.
So with Read Twitter they has deprecated api v1, now they recommend use 1.1.
Drats. Thanks for the heads up, swapping this ticket to be about the API change.
I was reading about changes in API and twitter forces auth to all requests maybe tutorial needs some update about it or got how to make requests to twitter w/o authentification.
Looks like we'll want application-only OAuth so the example will work for folks without twitter accounts (... like me).
I'm presently focusing on other stem improvements so I don't plan to invest time here in the near future - patches welcome!
Trac: Priority: normal to minor Summary: Crash stem tutorial in ExitNodes to Twitter example uses deprecated 1.0 API Status: needs_information to accepted
Trac: Description: I installed stem from pip
Python 2.7.3
Fedora 18
I am running the example To russia with love to reading twitter, i cp & paste code then run as tutorial says and get this output:
[ovnicraft@hphome test_stem]$ python tor_twitter.py Traceback (most recent call last): File "tor_twitter.py", line 32, in <module> 'ExitNodes': '{ru}', File "/usr/lib/python2.7/site-packages/stem/process.py", line 259, in launch_tor_with_config return launch_tor(tor_cmd, args, torrc_path, completion_percent, init_msg_handler, timeout, take_ownership) File "/usr/lib/python2.7/site-packages/stem/process.py", line 155, in launch_tor raise OSError("Process terminated: %s" % last_problem)OSError: Process terminated: No, it's still there. Exiting.
{"errors": [{ "message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}
This causes our example to fail with...
atagar@morrigan:~/Desktop/stem$ python twitter_script Traceback (most recent call last): File "twitter_script", line 39, in <module> print "%i. %s" % (index + 1, tweet["created_at"])TypeError: string indices must be integers
Patches welcome for migrating the example to the 1.1 API!
Sorry Sorry! Been busy with personal projects for quite a while.
TBH, I was lazy when I came up with the API 1, the 1.1 was way above me, so, now that I have used it in my own apps, I quite familiar.
Following does the job, but I would really appreciate if you change the keys & secrets to someone else's account (better if the account is made for stem).
The script works fine without Tor. (Didn't test it with Tor. Sorry. But it will work)
https://pastee.org/tf8s9
The keys & secrets can be obtained by signing up on dev.twitter.com (if you don't have an account, you need to create one on twitter first) & then creating an application. After the app creation (filling the form on dev.twitter.com/apps/new),
you'll be redirected to the app settings page which will have the consumer_key & consumer_secret. The access tokens can be generated there itself.
I am sorry, I need to improve on my documentation skills. Tweepy is a python library for creating twitter apps. Source - https://github.com/tweepy/tweepy
Unfortunately, the deprecation of API 1.0 forces us to use OAuth, hence I've used tweepy. I actually skipped everything that was unnecessary so that the example can be kept as simple & readable as possible. Finally, as you might've guessed, I forgot to import tweepy. I need to improve on verifying too.
So, we can not provide a tutorial using urllib anymore.
And, dont forget to "import tweepy".
Sorry for the mess-up. This bug shouldn't have been there in the first place if I had showed more courage on oauth. Won't happen again! :) Learning is fun!
Trac: Username: ashishnitinpatil Status: needs_information to needs_review
The keys & secrets can be obtained by signing up on dev.twitter.com (if you don't have an account, you need to create one on twitter first) & then creating an application. After the app creation (filling the form on dev.twitter.com/apps/new),
you'll be redirected to the app settings page which will have the consumer_key & consumer_secret. The access tokens can be generated there itself.
Only one twitter account is needed. Same is used to sign in on dev.twitter.
Hmmm, in that case it's not a very good example for our purposes. We were configuring urllib to go through a tor socks proxy, if we're using tweepy instead (which might or might not be using urllib) then this is no expanding on the earlier examples for using urllib through tor.
Maybe I should simply remove it from the page. Pity since this had been a nice real-world example.
Looks like I am not thinking straight, or thinking at all.
I will try to work on this, but I can't guarantee any time-limit.
Looks like I'll need to extract all that is needed for the oauth & also the actual tweet reading. Or maybe tweak tweepy to use the given socks proxy.
Well, I don't whether to remove it or not, but it's true that the example is pretty useless now since it won't work.
Trac: Username: ashishnitinpatil Owner: atagar to ashishnitinpatil Status: needs_information to accepted
Looks like I am not thinking straight, or thinking at all.
I will try to work on this, but I can't guarantee any time-limit.
Looks like I'll need to extract all that is needed for the oauth & also the actual tweet reading. Or maybe tweak tweepy to use the given socks proxy.
Well, I don't whether to remove it or not, but it's true that the example is pretty useless now since it won't work.
I can talk about with Jake here in Ecuador we'll get a little hackathon here and i will work in this. i hope i can fix it
I can talk about with Jake here in Ecuador we'll get a little hackathon here and i will work in this. i hope i can fix it
I am available for all the help you need! Today is the last day of my exams :)
I can talk about with Jake here in Ecuador we'll get a little hackathon here and i will work in this. i hope i can fix it
I am available for all the help you need! Today is the last day of my exams :)
Great for that, we will working in thursday we can chat in IRC with all of them !
Thanks sambuddhabasu! Does this work as-is or does it require the individual to fill in the constants you defined? I suspect the later unless Twitter allows anonymous read access.
Thanks sambuddhabasu! Unfortunately I don't have a twitter account to double check that the new example works so feel free to reopen if I messed something up. ;)
Trac: Status: accepted to closed Resolution: N/Ato fixed