This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Introduction to Twitter's API Forum

View Course » View Exercise

874 points
0359e8a1b00825768f220712d3d154b2?s=140&d=retro
Submitted by
onlyyouandty
almost 3 years ago

3 things I had to change before it worked

  1. change "screen_name"
  2. change "count"
  3. Add code to iterate through each tweets

Like so:

query = URI.encodewwwform(
"screen_name" => "twitterapi", ##example screen_name" => "@barackobama"
"count" => 10, ##change this from default 5 to 10
)

Print data about a list of Tweets

def print_timeline(tweets)
# ADD CODE TO ITERATE THROUGH EACH TWEET AND PRINT ITS TEXT
tweets.each { |tweet| puts tweet['text'] } ##use this
end


1 vote

permalink

Nice man, u're help me a lot on this one.

2762 points
Dc2020fdb37809915db237757e23a46b?s=140&d=retro
Submitted by
Juan_YO
over 2 years ago


1 vote

permalink

this was right on - thanks

590 points
54d208d99113cb1d39001d8f_657244308
Submitted by
Lindsay Sterett Seckman
over 2 years ago


0 votes

permalink

I had to add two more steps:
as a new user to Twitter, I had to create 10 tweets to get the code to pass.
Secondly, if you let the session time out (such as setting up a new Twitter account and creating tweets), you need to start over at step one, otherwise you will get an error.
Hope this helps someone else.

621 points
24bc5e806654262858dac9630fa009a3?s=140&d=retro
Submitted by
wdhays
about 2 years ago


0 votes

permalink

Thanks so much!

175 points
52e6d2078c1cccc1d1001f95_500980114
Submitted by
Ash King
almost 2 years ago