Skip to content

Commit

Permalink
display url titles
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfwood authored and LindseyB committed Jul 7, 2010
1 parent 6dab429 commit 535c873
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions XOmBot.pl 100644 → 100755
Expand Up @@ -43,6 +43,11 @@ sub on_public {

# grab what was said
my $text = $event->{args}[0];

if($text =~ m/(http:\/\/[^ ]*)/)
{
display_title($1);
}

if ($text =~ m/^\!wiki\s*([\w*\s]*)/)
{
Expand Down Expand Up @@ -123,6 +128,20 @@ sub get_wiki_entry {

}

sub display_title {
my $url = shift;

my $response = $browser->get("$url");

if($response->is_success)
{
if($response->content =~ m/<title>(.+)<\/title>/gsi)
{
$conn->privmsg($conn->{channel}, "\"$1\"");
}
}
}

sub search_for_article {

my $searchterm = shift;
Expand Down

0 comments on commit 535c873

Please sign in to comment.