jeroenjanssens / data-science-at-the-command-line

Data Science at the Command Line
https://datascienceatthecommandline.com
Other
3.8k stars 764 forks source link

Twitter API v1 is outdated #33

Closed pkiraly closed 4 years ago

pkiraly commented 9 years ago

Hi Jeroen,

on page 39 you call an outdated Twitter API:

$ curlicue -f credentials \
> 'https://api.twitter.com/1/statuses/home_timeline.xml'

It returns

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error code="64">
    The Twitter REST API v1 is no longer active. Please migrate to API v1.1.
    https://dev.twitter.com/docs/api/1.1/overview.
  </error>
</errors>

The actual API endpoint is

https://api.twitter.com/1.1/statuses/home_timeline.json

So the proper call would be

$ curlicue -f credentials \
> 'https://api.twitter.com/1.1/statuses/home_timeline.json'

however it returns JSON and not XML as expected in v1.0 call, but since it is the end of the pipeline, and the returned value is not processed, it is not a big issue. I guess the API was deactivated at the end of last year.

jeroenjanssens commented 4 years ago

Thank you for catching this. I'm closing this issue because I have started writing the second edition, but I will make sure to fix this.