Plugin:Twitter

From ShoutIRC RadioBot Wiki
Jump to: navigation, search

Contents

Plugin Info

This plugin adds support for tweeting songs and stream updates to Twitter.
For this plugin, you will need an access Token and Secret from Twitter. To generate a token for your plugin, follow these steps:

1. Log in to your www.ShoutIRC.com account and click on the My Account link.
2. Then click Twitter to go to the Twitter token page.
3. Click on the generate tokens link, and it will give you a URL to Twitter.com that will open in a new window.
4. On the new page at Twitter.com, click the Allow button and copy the PIN # you get afterwards.
5. Back on ShoutIRC.com, paste your PIN # into the text box and click the Continue button.
6. You will now see your token information and Twitter username, you can just copy/paste them into the Twitter section in your ircbot.conf

Not too hard, but unfortunately it's necessary for Twitter's authorization system.

Messages

This plugin uses 3 messages defined in ircbot.text.
All messages are undefined by default so if you do not define them in ircbot.text the plugin will not tweet anything.
I did it that way so you could easily enable/disable each item as you want.
Also, all the messages work just like Song/DJNew/DJChange in your channel.
For TwitterSongSource/TwitterSong:

If AutoDJ or SimpleDJ are active you can use the %songid% variable to get the songs internal ID. This could be used to link to your WebRequest for example.
%artisttag% - Song artist in #tag format, lowercase with spaces removed.
TwitterSong - The text to display when a new song is played.
TwitterSongSource - Optional alternate text to display when a new song is played if a source plugin like AutoDJ is active.
TwitterRequest - The text to display when a requested song is played.
TwitterDJNew - The text to display when a DJ comes on and there wasn't one on before.
TwitterDJChange - The text to display when a new DJ comes on and there was a DJ on before.

You can also put an _X at the end of the message name to define a different message for a specific Twitter account. X = the Account number, for example: TwitterSong_0

Messages Example

Here is an example of messages you could use:

TwitterDJChange=[Demo Radio] %olddj is Off --> Coming up: %dj
TwitterDJNew=[Demo Radio] Current DJ: %dj
TwitterSong=%dj is playing %song [Listeners: %clients/%max] [Requests: %req] [Song Ratings: %ratings%] [Song Rating: %rating% with %votes% vote(s)]
TwitterRequest=The current song was requested by %requestedby%

Twitter Commands

Commands Flags Needed Description
@BotsUsername !followme N/A Makes the bot's Twitter account follow you
@BotsUsername !unfollow N/A Makes the bot's Twitter account unfollow you

Configuration

See the Configuration page.

Libraries in Use

twitcurl (MIT License)

OS Support

Operating System: Windows 32-bit Windows 64-bit Native Linux/Unix 32-bit Linux/Unix 64-bit FreeBSD 32-bit FreeBSD 64-bit
Supported: Yes Untested Yes Yes Yes Yes



RadioBot vde

RadioBot main pages
Main PageInstallationChangelogCommandsPluginsFAQConfigurationCreditsRemote ClientBuilt-In VariablesMulti Sound Server ModeUsername Character Restrictions
Auto DJ Pages
Auto DJ Main PageWebRequest SystemSchedulerMP3 EncoderVoice SupportMySQL Plugin
Personal tools