1 8f7f2f4a 2021-12-17 jrmu ================================================================================
3 8f7f2f4a 2021-12-17 jrmu Creating a News Bot
5 8f7f2f4a 2021-12-17 jrmu In our third lesson, we'll create an IRC bot that reads the news.
7 8f7f2f4a 2021-12-17 jrmu Copy the code for rssbot.pl to your home folder:
9 8f7f2f4a 2021-12-17 jrmu $ cp rssbot.pl ~/rssbot.pl
11 8f7f2f4a 2021-12-17 jrmu Next, open up rssbot.pl using a text editor and make a few changes.
13 8f7f2f4a 2021-12-17 jrmu 1. Edit the server in line 32. Replace irc.example.com with the server's
14 8f7f2f4a 2021-12-17 jrmu real address. NOTE: Only IPv4 is supported.
15 8f7f2f4a 2021-12-17 jrmu 2. Edit line 35 to replace nickname with the nickname you want for the bot.
16 8f7f2f4a 2021-12-17 jrmu WARNING: The nickname must not already be taken, or else the bot will
17 8f7f2f4a 2021-12-17 jrmu fail to connect.
18 8f7f2f4a 2021-12-17 jrmu 3. Edit line 36 to replace username with the username you want for the bot.
19 8f7f2f4a 2021-12-17 jrmu The username is what appears in a /whois on IRC; it can be different
20 8f7f2f4a 2021-12-17 jrmu from the nickname.
22 8f7f2f4a 2021-12-17 jrmu Next, you'll want to make the perl script executable:
24 8f7f2f4a 2021-12-17 jrmu $ chmod u+x ~/rssbot.pl
26 8f7f2f4a 2021-12-17 jrmu Then run the script:
28 8f7f2f4a 2021-12-17 jrmu $ perl ~/rssbot.pl
30 8f7f2f4a 2021-12-17 jrmu On IRC, /join #perl103
32 8f7f2f4a 2021-12-17 jrmu Type !rss and the bot will show you the latest updates to the
33 8f7f2f4a 2021-12-17 jrmu IRCNow Almanack.
35 8f7f2f4a 2021-12-17 jrmu ================================================================================
37 8f7f2f4a 2021-12-17 jrmu Understanding RSSBot
39 8f7f2f4a 2021-12-17 jrmu Next, take a look at the file called ~/comments to see an explanation of
40 8f7f2f4a 2021-12-17 jrmu key lines in the program RSSBot.
42 8f7f2f4a 2021-12-17 jrmu ================================================================================