Introduction: Hacks #51-57
Search and
query
bots are very common on IRC. You may find that lots of IRC users will
use a bot in preference to a web-based search tool, simply because it
is less effort than starting up a web browser and typing in a URL.
The first hack shows you how to create a bot that performs Google
searches using the Google and PircBot APIs. Conveniently, most IRC
clients will highlight the resulting URLs and let you click on them
to load the page in your default web browser.
Web Services
provide powerful and easy ways to access information over the
Internet and present the results in your application. This chapter
shows you how to make some Java bots that employ Web Services to see
what the weather is like, translate languages, convert currencies,
and search for books on Amazon.
Not all searches have to be performed over the Internet. A more local
type of search can be used to determine if a certain user is
connected to your IRC network, even if she is not in any of your
channels. This is useful if you are trying to get a hold of somebody
who doesn't use IRC that much and connects only
infrequently.
|