#!/usr/bin/perl use strict; use warnings; package RSSBot; use base qw(Bot::BasicBot); use XML::RSS::Parser; my $url = 'https://wiki.ircnow.org/index.php?n=Site.AllRecentChanges?action=rss'; sub said { my $self = shift; my $arguments = shift; if ($arguments->{body} =~ /^!rss/) { my $p = XML::RSS::Parser->new; my $feed = $p->parse_uri($url); foreach my $i ( $feed->query('//item') ) { my $title = $i->query('title'); my $contributor = $i->query('dc:contributor'); my $link = $i->query('link'); $self->say( channel => $arguments->{channel}, body => $title->text_content.' - '.$contributor->text_content.': '.$link->text_content, ); } } } package main; my $bot = RSSBot->new( server => 'irc.example.com', port => '6667', channels => ['#perl103'], nick => 'nickname', name => 'username', ); $bot->run();