TweetIt 2.0.1

A Twitter API wrapper and authenticator for Spigot

  1. RictAcius
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    Contributors:
    Winterwell (jTwitter)
    [​IMG]
    TweetIt IS AN API NOT A PLUGIN! YOU WILL NEED A TweetIt DEPENDANT PLUGIN TO MAXIMISE ITS FUNCTIONALITY.
    -----------------------------------------------------------------------------
    TweetIt 1.0.0 is finally here! TweetIt 1.0.0 comes with added TwitterUser integration and TweetItEvents.
    Note: TweetItEvents are only fired when a plugin performs and operation. I am thinking of implementing localised events (events fired when a user does anything on twitter), and I'd like to know your opinion here.
    For more information, read the change log.
    ----------------------------------------------------------------------------
    TweetIt allows you to manage player's twitter accounts in-game. TweetIt manages the authentication for you. All user related data in encrypted before storage, so you know it's safe. Support is coming for a limiter, to allow server owners as well as players to directly restrict what a TweetIt dependant plugin can do on their account, rather than have Twitter do it for them.

    TweetIt links all your Twitter-related plugins and prevents the need for multiple verifications, which can be a pain for players with many accounts.

    If you want an example of how TweetIt can be used take a look at this example plugin or for TweetIt stream examples look at this. You may decompile the example plugins.

    [​IMG]
    The features of TweetIt are outlined below:
    • Authenticate users once.
    • Manage anyone's/anything's Twitter account.
    • Store user data in a secure manner.
    • Run debug with a simple command.
    • Use a pin/password system to allow users to 'log in' into their Twitter accounts.
    [​IMG]
    It is highly recommended to instal TweetIt as a dependency rather than as a library. To install TweetIt as a dependency:
    1. Click on the download link, select TweetIt and choose the most suitable download option for you.
    2. Place the downloaded .jar file into your plugins folder
    3. Restart your server.
    4. Follow the activation steps below:
    Once you have installed TweetIt you will need to activate it, to do so follow the following steps:
    1. Create a Twitter Application if you do not already have one.
    2. Copy your Consumer API and Consumer Secret into the config.yml file.
    3. Configure the options in the same file.
    4. Run the server command /tweetit reload to reload your config file.
    5. Enjoy!
    6. If you would like to test it first, run the server command /tweetit testauth as a logged in player.
    Only follow the following instructions if you want to make a TwetIt dependant plugin.
    If you are on Eclipse follow these instructions, other IDEs should be similar.
    1. Right-click your project, head over to Build-Path and click on Configure Build Path
    2. Click on Add External Jars and select the TweetIt.jar file
    3. Click on Apply
    4. Click on Ok
    5. In your plugin.yml add the line
    depend: [TweetIt] or depend: [...,TweetIt] if your depending on more than one plugin.​
    Code (Java):

    Getting a TwitterUser:
    //If the user is already registered (see below), you can use the user loader to get the user and their settings.
    //If not you can create a 'dummy' user with the specified type, ID and username, the username can be null, but it's best to ask for the player's username.
    //TweetIt will then automatically request the player's tokens for use next time.

    TwitterUser user = TweetItMethods.getUser(playerID, TwitterUserType.PLAYER);

    //If you wish to just create a dummy user use this:

    TwitterUser user = new TwitterUser(TwitterUserType type, String username);

    Checking if they are registered:
    //First Get the Authorizer instance

    UserAuthorizer auth = TweetItMethods.getUserAuthorizer();

    //Check if the user is registered *note you no longer need to request tokens the TweetItMethods method does that for you.

    if (auth.isRegistered(user.getId()) {
    //Do something
    } else {
    //end the operation.
    return true;
    }

    Doing things with a TwitterUser:
    //First, you need to get your TwitterUser (see above), then create a new Operation with the TwitterUser. The simplest is TweetIt.

    TweetIt operation = new TweetIt(user);

    //You can then send tweets, direct messages, get the user's timeline etc. This is an example of sending a tweet (of course, you can put whatever you want instead of "Hello world!").

    operation.sendTweet("Hello world!");

    Using TweetIt events:
    //TweetIt events are fired whenever a plugin performs a non-final operation in TweetIt.
    //To listen for a specific event... First, you need to add the annotation @TweetItEventHandler with a specified event this is so that TweetIt knows what event to send and where.
    //You would also need to add the event class as a parameter so that the event can be delivered successfully.

    @TweetItEventHandler(event = EventType.USER_SENT_TWEET)
    public void onTweet(UserSentTweetEvent event) {
    try {
    event.getPrimaryUser().message("Tweet Sent successfuly!");
    } catch (TweetItException e) {
    e.printStackTrace();
    }
    }
     

    [​IMG]
    <...> = REQUIRED [...] = OPTIONAL
    • /tweetit reload - Reloads config.
    • /tweetit dump - Creates error/debug info
    • /tweetit testauth - Tests authentication for your Twitter Application
    • /tweetit testauthchild <childID> - Tests Authentication for attachment users (Players only!) [childID = new child user ID]
    [​IMG]
    Please do not report bugs/errors/glitches in the reviews section, instead please post your issue on the GitHub page via the link below.
    [​IMG]
    If you're a developer and want to make your own version of TweetIt, if you want to report a bug in TweetIt or if you just want to see how TweetIt works, visit this link.

Recent Updates

  1. Updated "Updater" class
  2. Fix Download Link
  3. Update 2.0.0

Recent Reviews

  1. ItzTNTPvp
    ItzTNTPvp
    5/5,
    Version: 2.0.1
    I've used this API a ton! It's great, keep up the great work and updating it .
  2. Claushi
    Claushi
    5/5,
    Version: 1.1.0
    Wow! Its a very Nice API! <3
    1. RictAcius
      Author's Response
      Thanks! Don't forget to tell me what projects you use this API for, so I can feature them for you in the overview.
  3. ItsComits
    ItsComits
    5/5,
    Version: 1.0.1
    Hello, This is an awesome API. Very simple to use and easy to implement but I suggest for the new developers especially. Creating some sort of tutorial. But, apart from that i am rating this 5 stars :)