POE::Component::Server::Twirc - Twitter/IRC gateway
use POE::Component::Server::Twirc; POE::Component::Server::Twirc->new( irc_nickname => $my_irc_nickname, twitter_username => $my_twitter_username, twitter_password => $my_twitter_password, twitter_screen_name => $my_twitter_screen_name, ); POE::Kernel->run;
POE::Component::Server::Twirc provides an IRC/Twitter gateway. Twitter friends are added to a channel and messages they post on twitter appear as channel messages in IRC. The IRC interface supports several Twitter features, including posting status updates, following and un-following Twitter feeds, enabling and disabling device notifications, sending direct messages, and querying information about specific Twitter users.
POE::Component::Server::Twirc
Friends who are also followers are given "voice" as a visual clue in IRC.
Spawns a POE component encapsulating the Twitter/IRC gateway.
Arguments:
(Required) The irc nickname used by the owning user.
(Required) The username (email address) used to authenticate with Twitter.
(Required) The password used to authenticate with Twitter.
(Required) The user's Twitter screen name.
(Optional) The name of the IRC server. Defaults to twitter.irc.
twitter.irc
(Optional) The port number the IRC server binds to. Defaults to 6667.
The IRC user/host mask used to restrict connecting users. Defaults to *@127.0.0.1.
*@127.0.0.1
Password used to authenticate to the IRC server.
The name of the channel operator bot. Defaults to tweeter. Select a name that does not conflict with friends, followers, or your own IRC nick.
tweeter
Text to be used as the channel operator bot's IRC full name.
The name of the channel to use. Defaults to &twitter.
&twitter
The number of seconds between polls for new status updates. Defaults to 300 (5 minutes).
The number of seconds to wait before retrying a failed poll for friends, followers, or status updates. Defaults to 60 (1 minute).
An alias to use for displaying incoming status updates from the owning user. This is necessary if the user's IRC nickname and Twitter screen name are the same. Defaults to me.
me
If false, posts sent by POE::Component::Server::Twirc will not be redisplayed when received is the friends_timeline. Defaults to false.
Set echo_posts(1) to see your own tweets in chronological order with the others.
echo_posts(1)
How many favorites candidates to display for selection. Defaults to 3.
When displaying tweets for selection, they will be truncated to this length. Defaults to 60.
Experimental! If true, checks for @replies when polling for friends' timeline updates and merges them with normal status updates. Normally, only replies from friends are displayed. This provides the display of @replies from users not followed. It comes at the expense of an additional API call on each timeline poll, so keep that in mind when setting twitter_retry. Twitter imposes an API call limit of 100 calls per hour.
This also has the effect of adding senders of @replies to the channel, even though they are not followed.
Commands are entered as public messages in the IRC channel in the form:
command arg1 arg2 ... argn
Where the arguments, if any, depend upon the command.
Post a status update. E.g.,
post Now cooking tweets with twirc!
Follow a new Twitter user, id. In Twitter parlance, this creates a friendship.
Stop following Twitter user id. In Twitter, parlance, this destroys a friendship.
Block Twitter user id.
Stop blocking Twitter user id.
Displays information about Twitter user id, including name, location, and description.
Turns device notifications on or off for the list of Twitter IDs.
Mark friend's tweet as a favorite. Optionally, specify the number of tweets to display for selection with count (Defaults to 3.)
Turns reply checking on or off. See checke_replies in configuration.
Display a simple help message
Sends a direct message to Twitter user id using an IRC private message.
App::Twirc
Marc Mims <marc@questright.com>
Copyright (c) 2008 Marc Mims
You may distribute this code and/or modify it under the same terms as Perl itself.
To install POE::Component::Server::Twirc, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::Server::Twirc
CPAN shell
perl -MCPAN -e shell install POE::Component::Server::Twirc
For more information on module installation, please visit the detailed CPAN module installation guide.