News and Weather Scripts

They have: 4 posts

Joined: Nov 1999

I'm looking for news and weather scripts that pull in updated contents(like Yahoo or any local news site). Also I'm curious how these sites are pulling information off these servers. Like public server IP numbers for news and weather servers.

They have: 850 posts

Joined: Jul 1999

I use the
LWP::Simple module to do these.
I will give you an example of getting the latest headlines from Yahoo!

Code Sample:

#!/usr/local/bin/perl
use LWP::Simple;
@headlines=();
$ticker=0;

$html = get("http://dailynews.yahoo.com/h/ts/");

while ($html =~ m/<a href=\"http:\/\/dailynews.yahoo.com\/h\/nm\/(.+?)\/ts\/(.+?).html\"><b>(.+?)<\/b><\/a>/sogi)
{

    $headline = "<a href=\"http:\/\/dailynews.yahoo.com\/h\/nm\/$1\/ts\/$2.html\">$3<\/a><br>\n";
    if($headline)
{
push(@headlines,$headline);
$ticker=1;
}
}

if($ticker==1)
{
open(yahoo,">yahoo.txt");
close(yahoo);

open(yahoo,">>yahoo.txt");
print yahoo @headlines[0..4];
close(yahoo);

}

------------------
An ostrich's eye is bigger than it's brain.

They have: 1,587 posts

Joined: Mar 1999

what's the lwp module and where can one get it?

thanks in advance

------------------
Get paid to surf, email, and everything else online! 75 hrs a month at 55+ cents an hour! Beats AllAdvantage Easily. CLICK 4 DETAILS

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

They have: 850 posts

Joined: Jul 1999

LWP::Simple comes with activestate perl I know for sure, but I am nnto sure it if comes with the "normal perl for unix".

You can find more info about LWP::Simple by searching on cpan.org for it.

------------------
An ostrich's eye is bigger than it's brain.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.