Package com.patreonshout.utils
Class TwitterApiUtil
java.lang.Object
com.patreonshout.utils.TwitterApiUtil
public class TwitterApiUtil
extends java.lang.Object
This class is used to send new patreon posts to twitter
-
Field Summary
Fields Modifier and Type Field Description (package private) com.twitter.clientlib.api.TwitterApi
client
client is what we use to talk to the Twitter API -
Constructor Summary
Constructors Constructor Description TwitterApiUtil()
-
Method Summary
Modifier and Type Method Description void
send(java.lang.String text)
Sends a tweet to Twittervoid
sendTweet(java.lang.String clientId, java.lang.String clientSecret, java.lang.String userAccessToken, java.lang.String userRefreshToken, java.lang.String text)
Initializes the Twitter Api client we use to talk to Twitter's API then sends a messageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
client
com.twitter.clientlib.api.TwitterApi clientclient is what we use to talk to the Twitter API
-
-
Constructor Details
-
TwitterApiUtil
public TwitterApiUtil()
-
-
Method Details
-
sendTweet
public void sendTweet(java.lang.String clientId, java.lang.String clientSecret, java.lang.String userAccessToken, java.lang.String userRefreshToken, java.lang.String text) throws PSExceptionInitializes the Twitter Api client we use to talk to Twitter's API then sends a message- Parameters:
clientId
- is our Twitter app's client idclientSecret
- is our Twitter app's client secretuserAccessToken
- is the user's Twitter access tokenuserRefreshToken
- is the user's Twitter refresh tokentext
- is the body we want to send in the tweet- Throws:
PSException
- in case we have internal server errors
-
send
public void send(java.lang.String text)Sends a tweet to Twitter- Parameters:
text
- is the text we want to send to twitter
-