Hi, I hope someone can help me. I am trying to add news to my site as provided by an external source. They use HTTP authenication to gain access to the files that define the latest news. This is the example they give for perl.
"
In order to automate the process of authenticating and downloading, one
needs to have some skills in perl scripting. One could very easily
write a small perl script that uses the LWP perl module for user
authentication. As an example piece of code:
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
my $req = new HTTP::Request 'GET', 'http://newsite.com.au/finance.html';
$req->authorization_basic('userid', 'password');
my $result = $ua->request($req)->as_string;
This allows one to embed the username and password assigned to them into
a script that will complete the authentication process for them. From
here one simply needs to parse the returned file and extract the links
that are given. These links can be used in whichever way seen fit.
"
So my question, can I do this in PHP? and if so, can anyone point me in the right direction.
thank
len.