0

My code with user id:

status = twitter.getStatus(userId);

working correctly, but stores the last status.

I want store a status that i choose, with this code:

status = twitter.getStatus(userId);

But not works for certain users and throws me this error:

Exception in thread "main" winterwell.jtwitter.TwitterException$E404: Not Found HTTP/1.1 404 Not Found {"error":"No status found with that ID.","request":"/1/statuses/show/112779914381492224.json?include_entities=1&"} http://api.twitter.com/1/statuses/show/112779914381492224.json?include_entities=1& at winterwell.jtwitter.URLConnectionHttpClient.processError(URLConnectionHttpClient.java:364) at winterwell.jtwitter.URLConnectionHttpClient.connect(URLConnectionHttpClient.java:149) at winterwell.jtwitter.URLConnectionHttpClient.getPage(URLConnectionHttpClient.java:201) at winterwell.jtwitter.Twitter.getStatus(Twitter.java:1384) at extractordecaracterísticasentwitter.Tracker.listLocation(Tracker.java:83) at extractordecaracterísticasentwitter.Tracker.extractorTweets(Tracker.java:35) at extractordecaracterísticasentwitter.Main.main(Main.java:45) Java Result: 1

thanks for response and excuse me my english xD

matias
  • 59
  • 4

2 Answers2

0

Probably the ID doesn't exist?

The ID you posted throws this

{"error":"No status found with that ID.","request":"/1/statuses/show/112779914381492224.json?include_entities=1&"}

Mob
  • 10,958
  • 6
  • 41
  • 58
0

A 404 error (which is what you've got) means Twitter doesn't recognise the id number you've supplied.

This is because showById() expects the id of the tweet, whilst you're passing it a user-id. It's the wrong method for you (the use cases for showById are rare but valid).

Try Twitter.getUserTimeline(Long userId) instead.

Or you can use twitter.users().show(userId) to get info on the user, which includes their last tweet.

Daniel Winterstein
  • 2,418
  • 1
  • 29
  • 41