• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No response received on sending request to get tweets from Twitter using twitter4j API with token.

 
Monica Shiralkar
Ranch Hand
Posts: 843
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to fetch tweets for a particular keyword using the Twitter4J API. I am using twitter4j-core-2.2.5.jar. I pass OAuthAccessToken but on sending reuqest using the below lines I get no response:


It hangs after the third line above , without giving any response.


Here is my complete code:





thanks.




 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why use such an old version? I would upgrade to version 3, because that is best supported by Twitter itself. I once had to spend some time upgrading an application from 2.2 to 3.0 because of the API upgrade at Twitter.
 
Monica Shiralkar
Ranch Hand
Posts: 843
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.let me try the latest version.However I still do not know the reason for no response on sending request because either it would have thown an error message or a timed out message but in this case no response received. I will try version 3 and check.
 
Monica Shiralkar
Ranch Hand
Posts: 843
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot. Just changing the API to version 3 worked for me.It is working fine. I still do not know why earlier it did not giving any response instead of timeout or error.Anyway it working fine with version 3.Thanks again.
 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
Monica Shiralkar
Ranch Hand
Posts: 843
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On using the above code I am getting the response but it is contiously fetching.In such a case how do I display it on the web. I mean I kept this code into a method and returned arrayList but it does not come because it keeps fetching and fetching and I am not able to return it from a method which I plan to render on web.

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic