Opened 6 years ago

Last modified 4 years ago

#9003 closed defect

Twitter example uses deprecated 1.0 API — at Version 4

Reported by: ovnicraft Owned by: atagar
Priority: Low Milestone:
Component: Core Tor/Stem Version:
Severity: Keywords: website
Cc: ashishnitinpatil@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description (last modified by atagar)

Our example for reading Twitter feeds uses the 1.0 version of the Twitter API. This API has now been deprecated and queries fail with...

{"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!

Child Tickets

Change History (4)

comment:1 Changed 6 years ago by atagar

Status: newneeds_information

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.

comment:2 Changed 6 years ago by ovnicraft

Hi, ok following first part, i got it: https://gist.github.com/ovnicraft/5762810 my issue was solved.

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.

Cristian,
All the best

comment:3 Changed 6 years ago by atagar

Priority: normalminor
Status: needs_informationaccepted
Summary: Crash stem tutorial in ExitNodesTwitter example uses deprecated 1.0 API

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!

comment:4 Changed 6 years ago by atagar

Description: modified (diff)
Note: See TracTickets for help on using tickets.