public class TwitterV2Client extends Object
Modifier and Type | Field and Description |
---|---|
static DateTimeFormatter |
DATE_TIME_FORMATTER |
Constructor and Description |
---|
TwitterV2Client(TwitterCredentials twitterCredentials) |
Modifier and Type | Method and Description |
---|---|
Response |
getAllTweets(String query,
LocalDateTime startDateTime,
LocalDateTime endDateTime,
int maxResult,
String nextToken)
Currently only available via the Academic Research product track
https://developer.twitter.com/en/docs/twitter-api/tweets/search/api-reference
|
List<String> |
getFilteredStreamRules()
Returns the active rules on the streaming endpoint.
|
Response |
getFollowers(String username,
int maxResult,
String nextToken)
Returns the Followers of a given Twitter handle.
|
Response |
getFollowing(String username,
int maxResult,
String nextToken)
Returns the Twitter users that the provided Twitter handle is following.
|
Response |
getRecentTweets(String query,
LocalDateTime startDateTime,
LocalDateTime endDateTime,
int maxResult,
String nextToken)
Returns filtered public Tweets posted over the last 7 days.
|
Response |
getUserTimelineMentions(String username,
LocalDateTime startDateTime,
LocalDateTime endDateTime,
String sinceId,
String untilId,
int maxResult,
String nextToken)
Returns Tweets mentioning a specific Twitter user.
|
Response |
getUserTimelineTweets(String username,
LocalDateTime startDateTime,
LocalDateTime endDateTime,
String sinceId,
String untilId,
int maxResult,
String nextToken)
Returns Tweets, Retweets, replies, and Quote Tweets published by a specific Twitter account.
|
String |
searchUser(String username)
Returns the unique identifier of the provided Twitter handle.
|
void |
setupFilteredStreamRules(Map<String,String> rules)
Replaces the rules currently active on the streaming endpoint with the ones sent as parameter.
|
<T> Future<Response> |
startFilteredStream(<any> callback)
Streams filtered Tweets in real-time based on the added filter rules.
|
public static final DateTimeFormatter DATE_TIME_FORMATTER
public TwitterV2Client(TwitterCredentials twitterCredentials)
public Response getRecentTweets(String query, LocalDateTime startDateTime, LocalDateTime endDateTime, int maxResult, String nextToken)
public Response getAllTweets(String query, LocalDateTime startDateTime, LocalDateTime endDateTime, int maxResult, String nextToken)
public String searchUser(String username)
public Response getFollowers(String username, int maxResult, String nextToken)
public Response getFollowing(String username, int maxResult, String nextToken)
public Response getUserTimelineTweets(String username, LocalDateTime startDateTime, LocalDateTime endDateTime, String sinceId, String untilId, int maxResult, String nextToken)
public Response getUserTimelineMentions(String username, LocalDateTime startDateTime, LocalDateTime endDateTime, String sinceId, String untilId, int maxResult, String nextToken)
public <T> Future<Response> startFilteredStream(<any> callback)
public void setupFilteredStreamRules(Map<String,String> rules) throws Throwable
Throwable
Copyright (c) 2006-2023 North Concepts Inc. All Rights Reserved.