Bot-Cobalt-Plugin-YouTube

 view release on metacpan or  search on metacpan

lib/Bot/Cobalt/Plugin/YouTube.pm  view on Meta::CPAN

  my ($self, $core) = splice @_, 0, 2;

  my $response = ${ $_[1] };
  my $args     = ${ $_[2] };
  my ($req_url, $msg) = @$args;

  logger->debug("youtube_plug_resp_recv for $req_url");

  return PLUGIN_EAT_ALL unless $response->is_success;

  my $content = $response->decoded_content;

  my $html = HTML::TokeParser->new( \$content );

  my ($title, $short_url);

  TAG: while (my $tok = $html->get_tag('meta', 'link') ) {
    my $args = ref $tok->[1] eq 'HASH' ? $tok->[1] : next TAG ;

    if (defined $args->{name} && $args->{name} eq 'title') {
      $title = $args->{content}



( run in 0.278 second using v1.01-cache-2.11-cpan-26ccb49234f )