NAME
Bot::Backbone::Service::Web::LinkTitle - Retrieve the titles of links pasted into chat
VERSION
version 0.142250
SYNOPSIS
service link_titles => (
service => 'Web::LinkTitle'
);
# in chat
alice> https://metacpan.org/release/Acme-Fork-Bomb
bot> Acme-Fork-Bomb-2.0 - crashes your program and probably your system - metacpan.org
DESCRIPTION
Whenever someone pasts a link to a chat the bot is monitoring, the bot will use URI::Title to find the title or description of the linked document and report it back to the chat.
DISPATCHER
This monitors all chats and looks for links in them. It locates URLs in the messages using URI::Find. When a link is found, it is checked using URI::Title and whatever that module finds is reported to the chat.
ATTRIBUTES
exclude_urls
This is a list of regular expressions used to identify URLs you want to exclude from being checked. For example, you might frequently link to an internal site that requires a login that the bot does not have access to. You can keep it from trying to report the link titles of those, which would otherwise just be noise like "Please login".
METHODS
excluded_url
Checks to see if a URL matches any of the regexes in "exclude_urls".
find_links
Helper that finds URLs in text using URI::Find.
describe_links
Looks at every chat message and searches it for URLs to fetch the title/description and reports the title/description back to the chat.
initialize
No op.
AUTHOR
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Qubling Software LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.