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.
1,561
questions
0
votes
0
answers
16
views
Wrong tweets are fetched from twitter4j when bounding box is applied
I am using the following code snippet to filter out data for Hyderabad region, but i am getting tweets even from Maharashtra and China.
FilterQuery tweetFilterQuery = new FilterQuery();
double[ ][ ] ...
0
votes
0
answers
19
views
how to import twitter4j version in latest version of android studio
I want to import version 4.0.7 of twitter4j in the latest version of the IDE android studio, I already copied the file 'twitter4j-core-4.0.7-javadoc' in the libs folder, but at the moment of going to ...
1
vote
0
answers
40
views
How to Import Twitter Data Directly Into Database from Crawling by GeoCode (with Radius)?
I am referring this thread :
Twitter - Query for tweets within a radius of a particular GeoLocation
But my problem is I want to directly import it into database MySQL, instead of System.out.println.
...
0
votes
0
answers
43
views
TF-IDF similarity with twitter stream
I have collected many tweets using twitter4j and saved them into different text files. Now I want to consider several time windows of size 10 days and for each window I want to select its top 100 ...
0
votes
0
answers
24
views
Can't upload video to Twitter with Twitter4J
I'm using Twitter4J for posting. It works fine for text and images, but fails for videos. Here's the code im using
File file = new File("/path/to/v.mp4");
UploadedMedia media = null;
media = ...
0
votes
0
answers
39
views
Twitter media upload cause TwitterException {statusCode=-1, message=null, code=-1, retryAfter=-1, rateLimitStatus=null, version=4.0.7}
I'm trying to make server that upload tweet with image file.
Text-only tweet is working good
and changing account's profile is also good. So I think I have proper auth.
//this is working
twitter = ...
0
votes
1
answer
76
views
How to write a Future method in foreach concisely
I'm a beginner in Scala. Is there a concise way to write the following nested case statement?
def delete(
client : TwitterRestClient,
userId : Long,
keyword : String) : Unit = {
client....
1
vote
0
answers
57
views
How can I display/run the DirectMessagesList Twitter4J code on my App with a button on Android Studio?
I am trying to build an app on Android Studio that allows me to get my DMs but when I run the code it doesn't show anything.
I am using the following code:
public class HandlerActivity extends ...
0
votes
0
answers
46
views
Android NullPointerException twitter4j
I modified some code found in here and, I have a problem when I try to access an external, global variable from inside a tread in Android. I also need to return the same varible, or get it updated. It ...
0
votes
0
answers
22
views
Getting Connection time out when posting a tweet using java application with twitter4j
the code:
public String TwitterPst(String message) throws TwitterException {
ConfigurationBuilder config= new ConfigurationBuilder();
config.setDebugEnabled(true)
....
0
votes
1
answer
51
views
How do turn twitter IDs to Username in twitter4j? Or can I use id to get a user bio?
So I get a bunch of ids from
do {
if (0 < SklsIds.length) {
ids = twitter.getFriendsIDs(identlong, cursor);
} else {
ids = twitter.getFriendsIDs(cursor);
}
for (long ...
1
vote
0
answers
58
views
Application logs in, but redirects back to login
I have a piece of code that do not work, and I cannot understand why. As the subject says, it logs in to Twitter, but redirects back to the sign in button. setupTimeline(); is never executed.
I am ...
1
vote
1
answer
53
views
Package Twitter4j does not exist after packaging Jar
I am trying to create a Twitter app with Java, running the application from Idea works and the Tweet gets sent, however after running mvn clean package and java -jat TwitterClient-1.0-SNAPSHOT.jar, ...
0
votes
1
answer
33
views
Incorrect twitter API credentials with Twitter4j
I am trying to create a simple twitter desktop app with Java and Twitter4j, however after clicking the send tweet button, I am greeted with an unable to authenticate message, I'm fairly certain my ...
0
votes
1
answer
35
views
unreported exception twitter4j.TwitterException; must be caught or declared to be thrown
I have a code it provides that get twitter timeline i am trying to build a program but i see this error in intellij Idea:
java: unreported exception twitter4j.TwitterException; must be caught or ...
-2
votes
1
answer
101
views
Is it possible to retrieve deleted tweets or deleted accounts via twitter API?
I wonder is it possible to retrieve deleted tweets or deleted accounts via twitter API?
I know current accounts or tweets can be retrieved but what about the deleted ones?
0
votes
0
answers
37
views
How to fix Error 401/32 on Twitter v1 API using twitter4j?
I'm having an issue using the twitter4j to tweet that sometimes is throwing the error
401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you ...
1
vote
1
answer
40
views
Twitter4j getting blank or null for getCreatedAt and getCountry
I am streaming some Twitter data using Twitter4J and I am able to generate the tweet text.
The tweet is consumed by a TwitterConsumer class that is saving the text to Kafka.
So far everything works as ...
0
votes
0
answers
30
views
Twitter4j works well on emulators, but crash (ClassNotFoundException) after released
I'm using twitter4j to link my app to twitter functionality.
I wrote a code like following.
private const val CONSUMER_KEY = <my consumer key>
private const val CONSUMER_SECRET = <my consumer ...
0
votes
1
answer
33
views
Is there any option in order to get more than 10 twitter trending topics with twitter4j?
I am trying to get hashtags more used on Twitter. In fact, I am using twitter4j library as shown below:
Twitter twitter = new TwitterFactory().getInstance();
Trends trends = twitter.getPlaceTrends(1);
...
0
votes
1
answer
75
views
Java Twitter4j cant find properties file when using multiple Modules in Project
im trying to write a simple Java App with twitter4j and openjfx using intellij.
In Intellij i created a new Empty project and defined a few new Maven Modules inside this project to build a workspace ...
-1
votes
1
answer
35
views
Does Twitter4J search API support Twitter Premium or Enterprise API search end points
The main purpose of my application is to fetch tweets from twitter and i am using Twitter4J to do this. I have got standard twitter API.
My question is that, would the same implementation using ...
1
vote
1
answer
96
views
Twitter4j: User's profile URL is always null
I am trying to retrieve User's profile having a valid token. I am able to get the profile with all the info, but with no profile URL
Tried both
User user = twitter.users().showUser(twitter.getId());
...
6
votes
2
answers
506
views
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 ...
0
votes
1
answer
15
views
Is there any possibilities to fetch the login details upto the given date in twitter using rest api's?
In my app, I want the login details of the user i.e when and where(IP address)the user is login into the account.
0
votes
1
answer
73
views
Problem in Fetching the bearer token in twitter
My application needs to log in to each user and generate the bearer token for each of them. By using the bearer token I can fetch the result using Twitter API v2. Anyone, please help me how can I do ...
1
vote
0
answers
27
views
Twitter4j search
I'm trying to search on twitter tweets. I use Twitter4j libs.
My problem is that i want to search for hashtags that also contains the specified word i search.
For example:
If i search #hello i would ...
-1
votes
1
answer
173
views
Importing Twitter4j into Eclipse
I've imported the 4 twitter4j jar files into my project through the java build path, but when I import twitter4j.Twitter; & import twitter4j.TwitterFactory; I get a run-time error? The last two ...
0
votes
0
answers
83
views
error while writing a simple twitter streaming program in scala spark - Too many login attempts in a short period of time
This is my program:
import org.apache.spark.streaming.{Seconds, StreamingContext}
import twitter4j.TwitterFactory
import twitter4j.conf.ConfigurationBuilder
object TwitterHashtagStreaming {
def ...
0
votes
1
answer
1k
views
Does Twitter provide any api for reply a tweet or get list of replies
I want to integrate Twitter api in my application but I didn't find reply to a Tweet api in developers docs provided by Twitter. How can I get list of replies on a tweet or how can I reply to a tweet?
0
votes
0
answers
100
views
I cannot post a tweet using twitter4j
I'm trying to post a tweet using twitter4j and when I call the .updateStatus method it stops and gives me an error. This is all of my code: (I do have the keys/access tokens in my actual code)
...
-1
votes
1
answer
36
views
I'm making a java program to retrieve tweets with a specified hashtag and store them in a mysql database
I started by creating a database that contains a "tweets" table with two fields (ID and TEXT) then I made the connection to the database using JDBC... I'm going to know how to insert tweets ...
-1
votes
1
answer
65
views
How to create a Twitter Event Listener
today i tried out Twitter4J and noticed, there was a way to create a event. But i dont know how, because everytime i start it, its stopping itsself after less than 0.2 seconds. Can someone tell me ...
0
votes
1
answer
54
views
How to make for loop code block runs faster?
This is a twitter4j dependency. I am fetching the user's followers' data.
Below code takes nearly 15 seconds to finish to fetch data of 45 users data. What can be done to make this code runs faster? ...
0
votes
0
answers
91
views
How to get authToken before making an API call
Trying to make a get-user-search API call using the mentioned configurations as follows:
//pom.xml
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>...
-1
votes
1
answer
178
views
Can not register twitter webhook. {“errors”:[{“code”:32,”message”:”Could not authenticate you.”}]}
I am trying to register a endpoint for twitter webhook but it returns
{“errors”:[{“code”:32,“message”:“Could not authenticate you.”}]}
I am using twitter sample request to register webhook. Here is my ...
0
votes
1
answer
139
views
Java Twitter4J not showing source label under tweets
I've got Twitter4J implemented and sending tweets, however under the tweet there is no source label.
I'd like to show "sent from app name" or something along those lines.
Is this a setting ...
1
vote
1
answer
345
views
Why is twitter4j TwitterStream not filtering user's tweets?
I'm trying to stream a single user's tweets with twitter4j. Why is this TwitterStream not working? I've seen tweets come through that are replies to the intended user's tweets, but not the intended ...
0
votes
1
answer
369
views
Why does my twitter4j maven dependency not include TwitterStreamFactory?
I've been using twitter4j for months, doing simple getUserTimeline(), after creating TwitterFactory and Twitter instance with OAuth in Configuration. Works great.
But now I'd like to use the Streaming ...
0
votes
1
answer
205
views
Does twitter stream API allow filtering by urls?
I am trying to do a filter by urls but no result is being returned.
From the following doc, it shows it is possible https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/premium-...
0
votes
1
answer
204
views
Spark Scala NoClassDefFoundError: org/apache/spark/Logging
I've checked a bunch of other forums and posts, but I can't seem to narrow down the issue. All I keep seeing is people saying not to use logging and how it's deprecated, but I don't even know where I'...
0
votes
2
answers
340
views
scala.MatchError Message whenever I run Scala Object
The following piece of code is apart of a Twitter Streaming app that I'm using with Spark Streaming.:
val Array(consumerKey, consumerSecret, accessToken, accessTokenSecret) = args.take(4)
val ...
0
votes
2
answers
293
views
Twitter returning same trending topics for India for each of 24 town using WOE_ID
I have got the trends available for a location in India using trends/available API
{
'name': 'Bhopal',
'placeType': {
'code': 7,
'name': 'Town'
},
'url': 'http://where....
1
vote
2
answers
94
views
Twitter4j: Cannot use StatusListener cannot be resolved
I'm struggling with Twitter4j. I am using a Maven project with the following Twitter4j dependency:
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-...
1
vote
1
answer
133
views
How can I get the most liked tweet from a search result with Twitter4j?
I have tried using Collections.sort() to try sorting the list of tweets I got from searching in Twitter4j but it couldn't work because it doesn't sort based on a property (e.g listItem....
4
votes
1
answer
49
views
How to get the date of each twitter favorite using twitter4j
Trying to get the date of each twitter favorite Using the following code:
TwitterFactory tf = new TwitterFactory(cb.build()); Twitter twitter = tf.getInstance(); for (Status rt : twitter.getFavorites(...
0
votes
1
answer
221
views
akka timer giving message Cancel timer [Message] with generation [583]
i am using akka timer
i am using twitter streams and i am trying to get the number of tweets in 5 second
here is my code
case class PerSecond(tweet:Tweet)
case class TweetPerSecondCount(tweet:Tweet)...
0
votes
1
answer
35
views
twitter4s: how to return future from Action.async in play framework
i am using twitter4s and play-framework-2.4.3
i am fetching tweets sending to the actor for performing some processing on it and the actor needs to send back the response back to the controller ...
1
vote
0
answers
42
views
twitter4s: how to stop twitter streams from printing the logs to the console
i am using twitter4s https://github.com/DanielaSfregola/twitter4s
below is the code i am using for getting the twitter stream
val streamingClient = TwitterStreamingClient(consumerToken, accessToken)...
0
votes
2
answers
264
views
SparkStreaming/Scala/Twitter java.lang.NoSuchMethodError: twitter4j.TwitterStream.addListener(Ltwitter4j/StreamListener;)V
I'm trying to get tweets with IntelliJ and SBT, I'm using Spark 2.4.4, Scala 2.11.12, jdk1.8.0_231. The connection is local, I am not using cluster.
However I get this error, and I can't fix it, I ...