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

Introduction to Twitter's API Forum

View Course » View Exercise

477 points
Submitted by
Marco Morales
almost 4 years ago

Able to print tweet, but still get error message that won't let me continue...

My code for the first part of the exercise looks like this:

query = URI.encode_www_form("id" => "266270116780576768")

and for the second part, like this:

# Print data about a Tweet
def print_tweet(tweet)
# ADD CODE TO PRINT THE TWEET IN "<screen name> - <text>" FORMAT
puts tweet["user"]["name"] + " - " + tweet["text"]

I am able to retrieve this tweet successfully it seems:

uɐᴉɹoʞᴉɹʞ ᴉɟɟɐɹ - want to work on large scale? "Of course, we still have plenty more to do." #JoinTheFlock

But I get this error message, that will not let me continue:

Oops, try again. You did not generate the correct output. Did you print the username, followed by ' - ', followed by the Tweet text?

I've tried all suggestions on the forum and none has worked for me, any ideas?

11 votes


The user name has changed and was 'Raffi Krikorian' just put that instead of username

1787 points
Submitted by
Martin Brtan
almost 4 years ago


575270416eb971727600040f_71316918 frank williams almost 4 years ago

Thanks!!! Big Time!!!

504b04a997ef1e000201c43b_215380009 mokus almost 4 years ago

thanks :)!!

3bf307a3aa6d9ac2722b7c6a1b5e2949?s=140&d=retro ILU2014 almost 4 years ago

Thanks a ton :)

5a4e93da854be9ecb90000c6_160245580 Nacho Vargas almost 4 years ago

That not works for me...

3bf307a3aa6d9ac2722b7c6a1b5e2949?s=140&d=retro ILU2014 almost 4 years ago

@Nacho Vargas : puts "Raffi Krikorian" + " - " + tweet["text"]

5a4e93da854be9ecb90000c6_160245580 Nacho Vargas almost 4 years ago

Thanks a lot @ILU2014 I'm pretty sure that hours ago I introduce that line and not worked. But OK now. ;)

3bf307a3aa6d9ac2722b7c6a1b5e2949?s=140&d=retro ILU2014 almost 4 years ago

You're welcome :) @Nacho Vargas

3a6ff6d18d458c6db786b7b057d37df8?s=140&d=retro gibsonman507 almost 4 years ago

That's really fucking annoying...

288930a7ebbe292b6a19bdc3956abec1?s=140&d=retro Adrian almost 4 years ago

I've used this: puts "Raffi Krikorian" + " - " + tweet["text"]
I got the output right, but I can't move to the next lesson.
please help.

2 votes


There was a problem with the code checking. This answer works...

require 'rubygems'
require 'oauth'
require 'json'

baseurl = ""
path = "/1.1/statuses/show.json"
query = URI.encodewwwform("id" => "266270116780576768")
address = URI("#{baseurl}#{path}?#{query}")
request = address.request_uri

def print_tweet(tweet)
puts "Raffi Krikorian" + " - " + tweet["text"]

742 points
Submitted by
Paul Gerhartz
over 3 years ago

1 Comment

D0e1ba5c22d1e29ea09fea5e3acc552e?s=140&d=retro notyoutool over 3 years ago

Ugh. Yes, it would be great if the author or a moderator from Codecademy would fix this though. No fun having to debug and then write a hack when doing a tutorial.

0 votes


Having the same issues... its freaking annoying, also tried
puts tweet["user"]["screen_name"] + " - " + tweet["text"] and that didnt work either, my code is exactly like yours and Im beginning to just think its bugged

906 points
Submitted by
almost 4 years ago

1 Comment

9528625434a09078082d990ef7ebaa11?s=140&d=retro peacegiverman almost 4 years ago

Same. I assume the username changed and it was hardcoded in the check or that Unicode (upside-down letters) is causing problems.

0 votes


I'm assuming that @raffi is the author kurrik. So I kindly asked him to 1) either change his name back, or 2) modify the tutorial to use screen_name (which he is less likely to change for fun).

24 points
Submitted by
over 3 years ago