Class TwitterProvider
java.lang.Object
com.northconcepts.datapipeline.twitter.TwitterProvider
Non-streaming Twitter service provider.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTwitterProvider(String consumerKey, String consumerSecret) Creates a provider that uses application-only (OAuth 2 bearer token) authentication.TwitterProvider(String consumerKey, String consumerSecret, String accessToken, String accessTokenSecret) Creates a provider that authenticates with the given user access token, or application-only if it is empty. -
Method Summary
Modifier and TypeMethodDescriptionaddExceptionProperties(DataException exception) Returns the exception unchanged; subclasses can override to add provider details.ConfigurationBuilderReturns the twitter4j configuration used to create the client; changes after the first API call have no effect.Returns the HTTP proxy host, applied when the client is created on the first API call.Returns the HTTP proxy port, applied when the client is created on the first API call.getRateLimit(String rateLimitResource, String rateLimitKey) Calls the API for the current rate limit of the endpoint identified by resource family and key.protected TwittervoidsetHttpProxyHost(String httpProxyHost) Sets the HTTP proxy host, applied when the client is created on the first API call.setHttpProxyPort(Integer httpProxyPort) Sets the HTTP proxy port, applied when the client is created on the first API call.
-
Field Details
-
consumerKey
-
consumerSecret
-
accessToken
-
accessTokenSecret
-
-
Constructor Details
-
TwitterProvider
Creates a provider that uses application-only (OAuth 2 bearer token) authentication. -
TwitterProvider
public TwitterProvider(String consumerKey, String consumerSecret, String accessToken, String accessTokenSecret) Creates a provider that authenticates with the given user access token, or application-only if it is empty.
-
-
Method Details
-
getConfig
public ConfigurationBuilder getConfig()Returns the twitter4j configuration used to create the client; changes after the first API call have no effect. -
getHttpProxyHost
Returns the HTTP proxy host, applied when the client is created on the first API call. -
setHttpProxyHost
Sets the HTTP proxy host, applied when the client is created on the first API call. -
getHttpProxyPort
Returns the HTTP proxy port, applied when the client is created on the first API call. -
setHttpProxyPort
Sets the HTTP proxy port, applied when the client is created on the first API call. -
getTwitter
protected Twitter getTwitter() -
mute
-
getRateLimit
Calls the API for the current rate limit of the endpoint identified by resource family and key. -
addExceptionProperties
Returns the exception unchanged; subclasses can override to add provider details.
-