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

Introduction to Twitter's API Forum

View Course

554 points
Picture
Submitted by
Joe Combs
about 3 years ago

Tests broken for section 3/5 ?

My method for print_tweet:

def print_tweet(tweet)
puts tweet["user"]["screen_name"] + " - " + tweet["text"]
end

Prints this output:

"raffi - want to work on large scale? "Of course, we still have plenty more to do." #JoinTheFlock http://t.co/cEoSgiip"

But I still get the error:
"Oops, try again. You did not generate the correct output. Did you print the username, followed by ' - ', followed by the Tweet text?"

Is this broken for anyone else?


15 votes

permalink

If you search for 3/5 in the forum you will find this:

"Introduction to Twitter's API 3/5 Reading a Tweet, something wrong." from lane zhang posted 3 months ago. A guy posted the solution. Here it is

puts "Raffi Krikorian - " + tweet["text"]

UPDATE:

Ok, it seems that I cannot find the post I was referring to so here why it is broken.

As raincrash said below, Codecademy is comparing the string of the old username of Raffi Krikorian. Since he changed it to display it upside down you have to force the result. That is why you should write :

puts "Raffi Krikorian - " + tweet["text"] and not

puts tweet["user"]["screen_name"] + " - " + tweet["text"]

651 points
Ba5881eec34200e34f84f15fe060d599?s=140&d=retro
Submitted by
Alexandre Barret
about 3 years ago

6 Comments

06df7936fab9259d68670e525def268c?s=140&d=retro rebhatnagar almost 3 years ago

That's a bit of a cheat though, isn't it? Why is the Raffi Krikorian in the output upside down?

89928422d9a8d0c4ed5500a1987122dd?s=140&d=retro raincrash almost 3 years ago

It works! Maybe Raffi changed his username recently and Codecademy is string comparing with the old one.

5493375b937676af63005c27_481584944 Lamiaa El-morsy almost 3 years ago

It works.

50c511412caf70e9d900604b_17897982 Nicholas Rake almost 3 years ago

Geez, thank you guys. I thought I was getting humbled in Ruby all over again. There's got to be a way that students can report issues like this.

Picture Jesus Gonzalez almost 3 years ago

thank bro, this a bug them see down there i put a Screen shot of the problem

987304a3a8cf92d4e91adb99c7e5b90b?s=140&d=retro ajayvar15 over 2 years ago

Thnks!...


2 votes

permalink

Yup, same over here, too. Codecademy, please fix!

643 points
5a831642e23730cc555df3661797424b?s=140&d=retro
Submitted by
smbsimon
about 3 years ago


1 vote

permalink

puts "Raffi Krikorian" + " - " + tweet["text"]

This is another solution that passes

885 points
55a841b3d3292f0e91000328_629538139
Submitted by
Matt
over 2 years ago

1 Comment

4455bd3850c0bde913d7035515c04e26?s=140&d=retro Anpena over 2 years ago

This worked for me too. Looks like it is sensitive to the spaces between the " - " too.


1 vote

permalink

The line of code: puts "Raffi Krikorian" + " - " + tweet["text"]

is the right answer but make sure you put it in after line 40 where it is inside of the if.

Hope this clears things up after putting the id into line 10.

2199 points
D2ab9ab2ab880e0ce230394f9bc88cbc?s=140&d=retro
Submitted by
Martin
over 2 years ago


0 votes

permalink

I got the same error, but this was my output:

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

And I used puts tweet["user"]["name"] + ' - ' + tweet["text"] instead.

350 points
B49857a6f031631d6c5950d5bf912f9e?s=140&d=retro
Submitted by
dataWhiz21568
about 3 years ago


0 votes

permalink

Got the same thing, so annoying, thought somethign wrong with my syntax, since I am newbie at Ruby. But, assuming you guys have the same problem it is not about the syntax.

 def print_tweet(tweet)
  # ADD CODE TO PRINT THE TWEET IN "<screen name> - <text>" FORMAT
  puts tweet['user']['name'] + ' - ' + tweet["text"]
end

I got the same output
uɐᴉɹoʞᴉɹʞ ᴉɟɟɐɹ - want to work on large scale? "Of course, we still have plenty more to do." #JoinTheFlock http://t.co/cEoSgiip
nil

537 points
Picture
Submitted by
DaurenBaitursyn
about 3 years ago


0 votes

permalink

i make it works but i have the error any way what should i do ?
alt text

this have a bug so if you want to pass have to write this instead:
puts "Raffi Krikorian - " + tweet["text"]

745 points
Picture
Submitted by
Jesus Gonzalez
almost 3 years ago