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 Twitter
    void 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 message

    Methods 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 client
      client 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 PSException
      Initializes the Twitter Api client we use to talk to Twitter's API then sends a message
      Parameters:
      clientId - is our Twitter app's client id
      clientSecret - is our Twitter app's client secret
      userAccessToken - is the user's Twitter access token
      userRefreshToken - is the user's Twitter refresh token
      text - 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