- $p->handler(start => \@accum, "tagname, attr");
- $p->report_tags(qw(div));
- $p->utf8_mode(1);
- $p->parse($content);
-
- # Look for the post id in the div tags
- foreach $e (@accum) {
- if (exists($e->[1]->{'pokkariparameters'})) {
- if ($e->[1]->{'pokkariparameters'} =~ m|posts_id:"(\d+)"|) {
- $xml = $1;
- }
+ $p = HTML::TokeParser->new(\$content);
+ while ($tag = $p->get_tag('link')) {
+ if (($tag->[0] eq 'link') and
+ exists($tag->[1]->{'rel'}) and
+ ($tag->[1]->{'rel'} eq 'alternate') and
+ exists($tag->[1]->{'type'}) and
+ ($tag->[1]->{'type'} eq 'application/rss+xml')) {
+
+ $xml = $tag->[1]->{'href'};
+ $self->debug("Found RSS link: %s", $xml);