1=head1 NAME 2 3App::Twirc::Manual - User guide and reference for Twirc 4 5 6=head1 DESCRIPTION 7 8C<Twirc> is a twitter client. More precisely, it is an IRC/Twitter gateway that 9makes your favorite IRC client a twitter client. 10 11=head1 FEATURES 12 13=over 4 14 15=item Follow friends timelines 16 17=item Receive replies from friends and non-friends 18 19=item Post status updates 20 21=item Send and receive direct messages 22 23=item Follow, un-follow, block, unblock, and use most other twitter commands 24 25=back 26 27=head1 INSTALLATION 28 29You can install C<twirc> just as you would any other CPAN distribution: 30 31 cpanm POE::Component::Server::Twirc 32 33Or, you can download and unpack C<twirc>, then run it from a directory of your 34choice without running C<make install>. That's the way the author runs it. If 35you choose this option, run C<make> to install C<twirc>'s dependencies. 36 37=head1 CONTRIBUTING AND BUILDING 38 39If you'd like to contribute to C<twirc> or just want to build the distribution 40for some other reason, you must have the following Perl modules: 41 42=over 4 43 44=item L<Module::Install> 45 46=item L<Module::Install::Contributors> 47 48=item L<Module::Install::Repository> 49 50=item L<Module::Install::AutoManifest> 51 52=back 53 54=head1 CONFIGURATION 55 56C<Twirc> uses L<Config::Any>, so you can configure C<twirc> using XML, YAML, 57JSON, Apache-style configuration, Windows INI file format, or even Perl code. 58 59A configuration file is not necessary, but is recommended. 60 61Here's an example configuration in YAML: 62 63 state_file: twirc.state 64 log_level: INFO 65 66 67=head2 CONFIGURATION OPTIONS 68 69=over 70 71=item irc_server_name 72 73The name of the IRC server. Defaults to C<twitter.irc>. Every IRC server has a 74name. The IRC server included with C<twirc> isn't intended to be accessed 75publicly. It is for your own personal use. So, the name is not significant. 76 77=item irc_server_port 78 79The port number the IRC server binds to. Defaults to 6667. 80 81=item irc_server_bindaddr 82 83The local address to bind to. Defaults to all C<127.0.0.1> to prevent others 84from connecting to your C<twirc> IRC server. If you run C<twirc> on a different 85system than your IRC client, you will need to provide this configuration option 86with a suitable address. 87 88=item irc_mask 89 90The IRC user/host mask used to restrict connecting users. Defaults to 91C<*@127.0.0.1>. If you run C<twirc> on a different system than your IRC client, 92you will need to provide this configuration option with a suitable mask. 93 94=item irc_password 95 96Password used to authenticate to the IRC server. If you don't provide this 97option, no password will be required. It adds a bit of security. You may want 98to set this option if other users have access to your system. 99 100=item irc_botname 101 102The name of the channel operator bot. Defaults to C<tweeter>. Select a name 103that does not conflict with friends, followers, or your own IRC nick. 104 105When running C<twirc>, you interact with a bot in the channel. The bot carries 106out commands on your behalf and provides feedback, particularly when there are 107errors. 108 109=item irc_botircname 110 111Text to be used as the channel operator bot's IRC full name. Defaults to 112C<"Your Friendly Twitter Agent">. This is the name that will appear in 113response to an IRC C</whois> command. 114 115=item irc_channel 116 117The name of the channel where your twitter friends' timelines appear. This is 118the channel where most of your interaction with C<twirc> occurs. It defaults 119to C<&twitter>. The IRC convention for channels names is channels local to a 120single server begin with C<&>. Network channels begin with C<#>. You can use 121either to name, however C<&> is more appropriate. 122 123=item twitter_alias 124 125An alias to use for displaying incoming status updates from the owning user. 126This is necessary if the user's IRC nickname and Twitter screen name are the 127same. Defaults to C<me>. 128 129With the default value C<me>, when C<twirc> reads a status message in your 130timeline from your Twitter screen name, it will use C<me> in place of your 131Twitter screen name in the channel. 132 133=item selection_count 134 135How many status messages to display for selection when favoriting, replying, or 136retweeting. Defaults to 3. 137 138=item truncate_to 139 140When displaying a list tweets for selection, for example, in response to the 141L</"favorite"> command, they will be truncated to this length to avoid 142cluttering the screen with long messages that wrap. Defaults to 60. 143 144=item log_channel 145 146If specified, twirc will post log messages to this channel. If you set this 147option to C<&log>, then you can join the C<&log> channel and see the copious 148debug messages that C<twirc> generates. This may be useful for trouble 149shooting or problem reporting. 150 151=item log_level 152 153Twirc supports C<log_level> values OFF, FATAL, ERROR, WARN, INFO, DEBUG, and 154TRACE. The default is WARN. 155 156=item state_file 157 158File used to store state information between sessions, including Twitter OAuth 159access tokens, friends, and followers_ids. 160 161=back 162 163=head1 USING 164 165To use C<twirc> you first need to start the server: 166 167 bin/twirc -b --state_file=twirc.state 168 169The C<-b> option runs C<twirc> in the background. Drop the C<-b> to see log 170messages to STDERR. (The author runs twirc and his irc client in screen, 171L<http://www.gnu.org/software/screen/>, to monitor log messages to STDERR.) 172 173Next, connect to the server from your IRC client. I use C<irssi> 174(L<http://www.irssi.org>) and my examples will use C<irssi> commands: 175 176 /connect localhost 177 178On connection, C<twirc> will automatically join you to the configured channel. 179The default C<&twitter> will be assumed, here. 180 181Your friends will be automatically joined to the channel. Friends who are 182also followers are given voice as a visual clue. In C<irssi> they appear with 183plus sign (+) in front of their names. 184 185To post a new status update, use the L</"post"> command: 186 187 post My first tweet from twirc! 188 189In general, you enter a command followed by its arguments, if any, as a public 190message in the channel. There's a handy exception to that rule for sending 191replies. An entry that begins with a nick name, followed by a colon is treated 192as a reply. E.g.: 193 194 twirc: you make twitter usable! 195 196Is a shortcut for: 197 198 post @twirc you make twitter usable! 199 200C<twirc> uses the Twitter User Streams API to receive updates in real-time. 201 202Use IRC private messaging to send direct messages. In C<irssi>: 203 204 /msg friend Watch out, I'm right behind you! 205 206The C<twirc> server stops when you disconnect. This isn't normal IRC behavior, 207but C<twirc> isn't a normal IRC server. Its only purpose is to interface with 208Twitter on your behalf and server no useful purpose when you're not connected. 209 210=head1 COMMAND REFERENCE 211 212=over 4 213 214=item post status 215 216Post a status update. E.g., 217 218 post Now cooking tweets with twirc! 219 220=item follow twitter_screen_name 221 222Follow a new Twitter user. This creates a friend relationship and adds the 223friend to the channel. 224 225=item unfollow twitter_screen_name 226 227Stop following a Twitter friend. This destroys the friend relationship and 228removes the friend from the channel. 229 230=cut 231 232=item block twitter_screen_name 233 234Blocks the Twitter user from receiving your Twitter feed. 235 236=item unblock twitter_screen_name 237 238Stop blocking a Twitter user. 239 240=item whois twitter_user 241 242Displays information about Twitter user. C<twitter_user> can be either a screen 243name or email address. 244 245=item notify on|off twitter_screen_name... 246 247Turns device notifications on or off for the list of one or more Twitter 248friends. The list is space separated. 249 250=item retweets on|off twitter_screen_name... 251 252Turns retweet display on your timeline on or off for the list of one or more 253Twitter friends. The list is space separated. 254 255=item favorite friend [ count ] 256 257Mark a friend's tweet as a favorite. Optionally, specify the number of tweets 258to display for selection with C<count>. (C<count> defaults to 3. The default 259can be changed with the L</"favorites_count"> option.) 260 261=item rate_limit_status 262 263Displays information about the remaining number of API requests available in 264the current hour. The C<rate_limit_status> command does not count against the 265limit, itself. 266 267=item help 268 269Display a simple help message listing the available command names. 270 271=back 272 273=head1 TIPS AND TRICKS 274 275=head2 Ignoring 276 277If you're following a particularly noisy friend, you can of course 278L</"unfollow"> her. Alternatively, you can use your IRC client's features to 279ignore the user. In C<irssi>: 280 281 /ignore LoudMouth ALL 282 /ignore -except -pattern @YourName LoudMouth ALL 283 284Now, you won't hear from LoudMouth unless she @replies you, and she won't know 285you're ignoring her (unless she reads this tip!). 286 287=head2 Multiple accounts 288 289Although C<twirc> doesn't currently support multiple accounts, there's nothing 290stopping you from running multiple instances of C<twirc>, one for each 291account. 292 293Here's how I do it for accounts C<semifor> (my personal account) and C<twirc> 294(C<twirc>'s feed for update notices, etc.). 295 296First, the pertinent sections of the configuration files (in YAML format). 297 298 # File: semifor.yml 299 irc_server_port: 6667 300 irc_password: secret 301 irc_channel: '&twitter' 302 303 # File: twirc.yml 304 irc_server_port: 6668 305 irc_password: secret 306 irc_channel: '&twirc' 307 308Next, start an instance for each account: 309 310 bin/twirc -c semifor.yml -b 311 bin/twirc -c twirc.yml -b 312 313In your IRC client, connect to both instances (C<irssi> here): 314 315 /connect localhost 6667 secret semifor 316 /connect localhost 6668 secret twirc 317 318Now you've got 2 channels, one for each account---in my case, C<&twitter> for 319C<semifor> and C<&twirc> for C<twirc>. 320 321=head2 PLUGINS 322 323Plugins are modules that are optionally included by specifying them in user 324configuration file in the C<plugins> section. Some of the plugins included in 325the distribution are: 326 327=over 4 328 329=item SquashWhiteSpace 330 331Squashes whitespace in tweets to a single space. See L<App::Twirc::Plugin::SquashWhiteSpace>. 332 333=item BangCommands 334 335Commands are prefixed with a bang (i.e., exclamation point "!"). Text entered 336without a bang prefix is posted as a status update. See L<App::Twirc::Plugin::BangCommands>. 337 338=back 339 340=head1 SUPPORT 341 342C<Twirc> is free open source software with no warranty of any kind. That said, 343it's used by some competent perl coders who may be able to help if you have 344trouble. Try the C<#net-twitter> channel at C<irc.perl.org>. 345 346The code repository with the development branch is located at 347L<http://github.com/semifor/twirc>. New features, and bug fixes appear there 348before they hit CPAN, so check the commit log there to see if a problem you've 349found has been addressed. And feel free to use the development branch. 350 351=head1 CONTRIBUTORS 352 353Peter Roberts <me+dev@peter-r.co.uk> 354 355=head1 AUTHOR 356 357Marc Mims <mmims@cpan.org> 358 359I'm C<semifor> on twitter and IRC. 360