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
6
votes
2 answers

Post a Tweet with twitter4j

I have a twiiter app with: // Bearer token // API key // API key secret // Access token: // Access token secret: and Read, Write, and Direct Messages permissions I use a ConfigurationBuilder class to configure Twitter4J programmatically in…
Nuñito Calzada
  • 4,394
  • 47
  • 174
  • 301
6
votes
2 answers

How do I find the retweet count with Twitter4J?

As the title says, I'm using the Twitter4J API and I cannot seem to find how to count the retweets of a "Tweet" instance.
ManAmongHippos
  • 511
  • 1
  • 5
  • 9
6
votes
1 answer

How to enable Enhanced URLs enrichment on Twitter API?

I'm creating an application that consumes the twitter api. I'm retrieving the tweet's and showing users. In some cases tweets have links, as you can see in the image below. Reading the api documentation for twitter, I found something called…
João Armando
  • 167
  • 2
  • 12
6
votes
5 answers

Unable to iterate Java List in Scala

I'm using the Java Twitter4J library in a Scala project. I'm calling the method twitter.getFriendsStatuses() This method returns a list of twitter4j.User objects containing statuses. I try to iterate over them and it goes in an infinite loop over…
Sri
  • 5,805
  • 10
  • 50
  • 68
6
votes
1 answer

Get count of reply to a particular tweets

I am using the Python tweepy library. I was successfully able to extract the 'liked' and 're-tweet' counts of a tweet using the below code: # Get count of handles who are following you def get_followers_count(handle): user =…
Prakash P
  • 3,582
  • 4
  • 38
  • 66
6
votes
3 answers

Extend a Java Library by adding methods to it

I'm trying to understand how to properly "extend" 3rd party libraries (with both classes and interfaces) in Java and how to simply use them as drop-in replacements. I'm currently using the Twitter4J library. Right now I have to manually prepend @…
Sheharyar
  • 73,588
  • 21
  • 168
  • 215
6
votes
2 answers

Android Twitter xAuth example using twitter4j

Android: I am trying the following xAuth example for android share. xAuth Authentication for Twitter Share in Android? System.setProperty("twitter4j.oauth.consumerKey", "your token"); System.setProperty("twitter4j.oauth.consumerSecret", "your token…
d-man
  • 57,473
  • 85
  • 212
  • 296
6
votes
8 answers

java.lang.NoClassDefFoundError: com.google.android.gms.R$string

I am having a little trouble with the complier, Same code I use on Nexus 5, no error. as Soon as I use it in Tablet, it crash right away and the error said java.lang.NoClassDefFoundError: com.google.android.gms.R$string with brunch of unknown…
NOT_A_PROGRAMMER
  • 1,794
  • 2
  • 20
  • 31
6
votes
1 answer

How to get tweets of a specific user using twitter4j

I am writing an app that should fetch tweets of a specific twitter user. So I have to colect screen name first then should fetch tweets. I tried with the below code. package gethometimeline; import twitter4j.*; import java.util.*; import…
rgk
  • 800
  • 1
  • 11
  • 32
6
votes
2 answers

Using the Twitter Streaming API

I need to notify my app of new tweets in real time from a selected few users. AFAIK, to do this I need to use the Twitter Streaming API. I have come across Twitter4J but i am not quite sure how to use this with the Streaming API. Does anyone know of…
Orbit
  • 2,985
  • 9
  • 49
  • 106
6
votes
1 answer

Batch Size in Spark Streaming

I am new to Spark and Spark Streaming. I am working on Twitter streaming data. My task involves dealing with each Tweet independently like counting the number of words in each tweet. From what I have read, each input batch forms on RDD in Spark…
Naren
  • 457
  • 2
  • 10
  • 19
6
votes
0 answers

message - Your credentials do not allow access to this resource. code - 220

This question has been asked numerous times but I have not found any solutions. In my application the user tweets a message and picture. Up until the past few days there have been no issues in relation to this. However in the past few days I have…
DJ-DOO
  • 4,545
  • 15
  • 58
  • 98
6
votes
4 answers

REST API, regarding 403 error code?

We are posting Tweets to multiple accounts from same IP address using software application. And in response from twitter , we are getting 403 error code, API used by us is REST API. Is there any limitations on IP address, because surely we are not…
astack
  • 3,837
  • 7
  • 22
  • 21
6
votes
1 answer

Twitter4j TwitterStream or BufferReading causing java.lang.OutOfMemoryError: Java Heap Space

This is my first Stackoverflow post, sorry if it's not great. Feedback will definitely help! I'm currently running into a java.lang.OutOfMemoryError: Java Heap space problem with a project I'm working on using the Twitter Streaming API. The error…
xDranik
  • 231
  • 1
  • 3
  • 8
6
votes
2 answers

Strange SQLiteException not in all devices

I have a button which when pressed opens twitter login page in a webview (as an activity). i'm using twitter4j version 2.2.6. the problem is this- when i click on the emulator or my samsung glaxy 2 it works perfectly witout any bugs, but when i…
user1765048