lookupbot.pl

The lookupbot.pl script has a variety of triggers that will hit the relevent website, scrape the content and return it in text form through IRC. Each one takes a specific parameter or search term, and a simple hash of triggers and function references means that more triggers can be added very easily.

There are two different kinds of triggers; public and private. Public triggers must begin with a ! (e.g. !google) and will respond when somebody uses the trigger at the start of a line in a channel. Private triggers must not begin with a !, and will only respond if the nick hosting the script receives a private message. Note that public triggers will respond privately, too.

New features in 1.1 include a better separated responder and request processor so requests can be called recursively (see the !tdm implementation for an example). Also, optional caching of content to prevent so many network round trips.

A number of triggers already exist, most of which were added at the request of others. These are:

!google <search terms>
Return the first Google hit for the provided search terms
!image <search terms>
Return the first Google images hit for the provided search terms
!define <word or phrase>
Return the first Google definition of the word or phrase
!urban <word or phrase>
Return the first Urban Dictionary entry for the specified word or phrase, or the first search result if no specific entry exists
!profan <word>
Return the Profanisaurus entry for the specified word
!wwotd
Return the current Worthless Word of the Day from WWFTD
!wotd
Return the current word of the day from dictionary.com
!uwotd
Return the current word of the day from urbandictionary.com
!slogan <noun>
Return a slogan from the the Sloganizer for the specified noun
!compliment
Return a randomly generated compliment from The Surrealist Compliment Generator
!limerick [entry ID]
Return the limerickdb.com entry specified by the entry ID. If no entry ID is specified, return a random entry.
!bash [entry ID]
Return the bash.org entry specified by the entry ID. If no entry ID is specified, return a random entry.
!memetic [entry ID]
Return the memetic.org entry specified by the entry ID. If no entry ID is specified, return a random entry.
!cricket
Return the score for any current England cricket game in progress using scores from cricinfo.com
!cndb <actor or actress>
Return a list of films the requested actor/actress has appeared nude in, from the Celebrity Nude Database
!horoscope <starsign>
Return the horoscope for the specified star sign from astrology-online.com
!horrorscope <starsign>
Return a bizarre horrorscope for the specified star sign from emilystrange.com
!bored
Return an interesting link from bored.com
!joke
Return a random joke from ajokeaday.com
!tdm [n]
Return a random story summary from thedailymash.com's rss feed, or the n'th entry if n is specified.
tinyurl <url>
Return a tinyurl pointing at the specified URL. Only works as a private message, seeing as the idea is to prevent cluttering the channel with long URLs

To use lookupbot.pl, you just need Irssi, CGI, LWP::Simple and LWP::UserAgent.

download lookupbot.pl