Questions tagged [twitter4j]

Twitter4J is a library enabling calls to the Twitter API from Java. With Twitter4J, you can easily integrate your Java application with the Twitter service. Twitter4J is an unofficial library.

With Twitter4J, you can easily integrate your Java application with the Twitter service.

Features

  • 100% Pure Java - works on any Java Platform version 5 or later
  • Android platform and Google App Engine ready
  • Zero dependency: No additional jars required
  • Built-in OAuth support
  • Out-of-the-box gzip support
  • 100% Twitter API 1.1 compatible
1563 questions
11
votes
2 answers

Why the method getOAuthAccessToken always fire the exception in the twitter4j api?

I'm following a lot of instructions to make a simple tweet from my app. I've already registered it on Twitter, but I just can't make a tweet. I can login, but not update my status. Here's the code to login private void twitterLogOn() { …
MetalCraneo
  • 335
  • 1
  • 4
  • 14
11
votes
7 answers

twitter4j: 401 authentication credentials missing or incorrect

I'm currently trying to get the userTimeline of a bunch of users. This has worked for me in the past, but now doesn't work anymore. I'm using twitter4j and using oauth. I've registered 2 applications on my account so far, which both should be able…
jcfrei
  • 1,819
  • 4
  • 19
  • 35
11
votes
2 answers

Twitter4j integration through Android Studio

I am trying to integrate Twitter4j library into Android project through Android Studio. Though there are enough materials for integration through Eclipse, there are no materials for integration through Android Studio. How to do the integration?
Mat
  • 581
  • 3
  • 9
  • 23
11
votes
2 answers

Getting "err" : "E11000 duplicate key error when inserting into mongo using the Java driver

Exception in thread "main" com.mongodb.MongoException$DuplicateKey: { "serverUsed" : "localhost/127.0.0.1:27017" , "err" : "E11000 duplicate key error index: twitterdb03.LevelAFollowers.$id dup key: { : ObjectId('52d5636de408652b4853a8fe')…
Nautilus_o
  • 111
  • 1
  • 1
  • 5
11
votes
2 answers

Service provider responded in error: 301 (Moved Permanently) - Twitter API 1.1

I get this error when trying to connect to Twitter? Why? 02-18 16:40:33.270: W/System.err(7167): oauth.signpost.exception.OAuthCommunicationException: Communication with the service provider failed: Service provider responded in error: 301 (Moved…
emeraldhieu
  • 9,380
  • 19
  • 81
  • 139
11
votes
2 answers

Twitter integration:consumer key/secret pair already set

Trying to integrate my webapp with Twitter using twitter4j lib. I have registered my app on twitter site and got Consumer key and Consumer secret values. Nothing special,standard OAuth step. code: public class TwitterService { private final…
sergionni
  • 13,290
  • 42
  • 132
  • 189
10
votes
1 answer

android twitter4j authentication via installed twitter app not browser

i am using twitter4j in my android application to post status to twitter like in this example: http://www.androidhive.info/2012/09/android-twitter-oauth-connect-tutorial/ All is working good but the question is: The authentication is done via…
H.Android
  • 198
  • 1
  • 1
  • 12
10
votes
4 answers

How to retrieve more than 100 results using Twitter4j

I'm using the Twitter4j library to retrieve tweets, but I'm not getting nearly enough for my purposes. Currently, I'm getting that maximum of 100 from one page. How do I implement maxId and sinceId into the below code in Processing in order to…
hapless_cap
  • 217
  • 1
  • 3
  • 10
10
votes
3 answers

twitter application only authentication java android with twitter4j

I'm trying to get a user timeline from twitter with oauth2 (for application-only authentication) but the result is always null. I don't have experience with OAUTH , and I have looked to a couple tutorials and examples, but with no luck so far. I …
pieter
  • 385
  • 1
  • 4
  • 19
10
votes
2 answers

Using Twitter4j in android, getting lint error in library - Invalid package reference in library

I am using twitter4j in an android app for using twitter API. Everything works fine, and I have no problem with the library. Today I ran lint and getting lint errors in the twitter4j-core-3.0.3.jar. I dont have control over this third party…
Gaurav Vashisth
  • 7,547
  • 8
  • 35
  • 56
10
votes
1 answer

Android twitter4j upload image

I have an android app through which I can successfully update the twitter status. I am using it to share links to a webpage which displays an image. I think it will be nice to have a scaled down preview of the image along with the tweet the same way…
Rameez Hussain
  • 6,414
  • 10
  • 56
  • 85
10
votes
2 answers

How to get a tweet with its full JSON in Twitter4j

I need to retrive a list of tweets, with many informations (easily retrievable from some Tweet.getX() methods) except for the tweet's entire JSON. I can't figure out how to get the JSON of a tweet belonging from a QueryResult. Anyone can help me?
andreaxi
  • 931
  • 5
  • 15
  • 28
9
votes
6 answers

method retrieveRequestToken raises "Communication with the service provider failed: null"

I am using twitter4j to send tweet from my application. When I invoke the method retrieveRequestToken, I get the error "Communication with the service provider failed: null". public static void askOAuth(Context context) { try { // Use…
Guillermo Tobar
  • 344
  • 4
  • 17
9
votes
2 answers

Login Twitter to show the error "android.os.NetworkOnMainThreadException"

I have develop one application.Now i am trying to integrate the twitter in my application.My problem is when i login the application it show "android.os.NetworkOnMainThreadException" "at…
Satheesh
  • 1,722
  • 25
  • 35
9
votes
4 answers

Get Tweets with Pictures using twitter search api

Is it possible to get tweets which contain photos? I am currently using twitter search api and getting all the tweets having entity details by setting include_entities=true. I see picture details under media object but is there anyway to filter…
Hemant P
  • 143
  • 2
  • 2
  • 8