I have a small section of Perl code that Does not appear to be working (see below). Basically it uses LWP::Simple to get a list of online chatters from my chat area, and it is suppose to display who is online . The URL is also hosted on my site as well and I know it works. When that URL is called, it produces the following (assuming "eddie" and "sue" is online):
1 user is connected to the server
eddie
sue
---
Here is part of the Perl script that calls the PHP script:
if ($uid) {
use LWP::Simple;
my $url = "[login to view URL]";
my $online = get($url);
foreach my $line ( split(/\n/,$online) ) {
if($line =~ m#<li>(.*)</li>#isog) {
my $cusr = lc($1);
$chatting{$cusr}++;
}
}
}
---
I believe this part is working as I have tested LWP::Simple on my server and all appears to be fine with it. If this part is working, the section below is what displays whether the user is online or offline:
if ($uid) {
if ($chatting{$blog{'user_name'}}) {
$on_status = qq^ <div>$l_visit <br><img border="0" src="$global{admin_image_path}/[login to view URL]" width="15" height="15" align="absmiddle" style="margin-right:2px;"> <a title="start chatting" href="javascript:ChatPop('[login to view URL]');"><font color="#00AD00">is chatting</font></a></div>
<div class="userPanelButtons">
<br>
</div>\n^;
} else {
$on_status = qq^ <div>$l_visit <br> <img border="0" src="$global{admin_image_path}/[login to view URL]" width="15" height="15" align="absmiddle" style="margin-right:2px;"> <a title="start chatting" href="javascript:ChatPop('[login to view URL]');">not chatting</a></div>
<div class="userPanelButtons">
<br>
</div>\n^;
}
I believe this to be a pretty quick fix, but I do not know what to look for. I would be looking to pay $30. I am available via Google Talk to quickly award a winner and text a solution. This coding used to work, but for some reason, it stopped a while back.
Thanks, Ed