note
tye
<p>
The error is:
<code>
Could not find
in at PerlMonks/NewestNodes.pm line 202
</code>
(someone mentioned in chatter getting this same error
message) which is happening because this (edited) code
does the indicated things:
<code>
sub get_and_cache_nodes {
my ($self, $url, $update_info)=@_;
# $url starts "http://www.perlmonks.org/index.pl?node="
# . "node+query+xml+generator&nodes=47259,"...
my $text=$self->getpage($url);
# $text ends up "\r\n"
if (!defined($text)) {
warn "Error obtaining page: $@\n";
return;
}
# The next regex does nothing
$text=~s!<NODE>\s*</NODE>!!g;
# This line causes the error:
my $tmpxml=XMLin($text, keyattr => { AUTHOR => "+node_id",
NODE => "+node_id" },
forcearray => [ 'AUTHOR', 'NODE' ]);
</code>
I don't have a cookie set (because I don't like the Tk Chat
client "stealing" my XP updates nor having it make it appear
like I'm around and paying attention when I'm probably busy
doing other things) so my next task was to figure out how
to set my login cookie and how to get NewestNodes to use
it but not the Tk Chat Client.
</p><p>
Also, I had to set a HOME environment variable before any
of this would work. Not all environments have a $ENV{HOME}
set so you might want to make the code more portable in that
respect.
</p><p>
BTW, I'd still like the split in "New Notes" as even when I
get Tk Newest Nodes working, I won't always be using it.
</p>
-
<a href="/index.pl?node=tye&lastnode_id=1072">tye</a>
(but my friends call me "Tye")
47272
47404