Skip to content
Richard Banks edited this page Aug 16, 2014 · 1 revision

Configuration:

In you Eve.rb file you should add the Twitter API keys and uncomment the applicable lines or the :Twitter plugin will not work. This is where you would add them:

   c.plugins.options[Cinch::Plugins::Twitter] = {
   access_keys: {
   consumer_key: "key",
   consumer_secret: "key",
   oauth_token: "key",
   oauth_token_secret: "key"
    }
  }

Initializing:

The Twitter plugin is based off of a gem. In order to use it you must first install the gem it runs off of:

gem install cinch-twitter


Basic Usage:

When in a channel you can call the plugin's basic functions into action by using:

@twitterhandle

!tw twitterhandle

This will cause the bot to return with the latest tweet from the handle your are querying.

Example:

[17:37:15] <@Namaste> @ringsidefans

[17:37:15] <@Eve> RingsideFans � Register at http://ringsidefans.com to discuss #WWE and other pro-wrestling products. It's free with contests for regular posters! (at Nov 22 2013, 7:58 PM CST � via Twitter for Android) https://twitter.com/RingsideFans/status/404066438723674112


Advanced Usage:

Now when we are in the channel and would like to find more tweets from the user it's actually quite simple. We just call the command into action again but this time we add -.

For example:

[17:41:33] <@Namaste> @ringsidefans-2

[17:41:33] <@Eve> RingsideFans � We're trying to build a huge network of wrestling fans @ http://ringsidefans.com join the community! It's free! (at Nov 22 2013, 5:40 PM CST � via Twitter for Android) https://twitter.com/RingsideFans/status/404031789699592192

[17:41:42] <@Namaste> !tw ringsidefans-2

[17:41:42] <@Eve> RingsideFans � We're trying to build a huge network of wrestling fans @ http://ringsidefans.com join the community! It's free! (at Nov 22 2013, 5:40 PM CST � via Twitter for Android) https://twitter.com/RingsideFans/status/404031789699592192

You will notice that I brought the bot into action by sending @twitterhandle-2. This actually looks for the user's third to last tweet, and delivers it to the channel. Same as using !tw twitterhandle-2.


Replies:

Now we may have a tweet that is in reply to another.

For Example:

[17:46:53] <@Namaste> @rickahbanks-2

[17:46:54] <@Eve> RickahBanks � @WWEBrayWyatt I don't know, follow the buzzards and you may find out (at Nov 29 2013, 11:15 AM CST � via Twitter for Android) https://twitter.com/RickahBanks/status/406471560447676416 in reply to https://twitter.com/WWEBrayWyatt/status/406467746265071617

Notice that it says "in reply to" beneath the bottom two URLs. The long numbers on the end of the URLs are Twitter Status IDs. They are the way the Twitter server sorts tweets. So, using the :Twitter plugin in EVE you can find out what that user was replying to by taking the long number from the end of the final URL and querying it in the IRC channel.

For example:

[17:49:38] <@Namaste> @#406467746265071617

[17:49:38] <@Eve> WWEBrayWyatt � What the Hell is He building in There!!!!! (at Nov 29 2013, 11:00 AM CST � via Twitter for iPhone) https://twitter.com/WWEBrayWyatt/status/406467746265071617

[17:50:03] <@Namaste> !tw #406467746265071617

[17:50:03] <@Eve> WWEBrayWyatt � What the Hell is He building in There!!!!! (at Nov 29 2013, 11:00 AM CST � via Twitter for iPhone) https://twitter.com/WWEBrayWyatt/status/406467746265071617