Click to See Complete Forum and Search --> : Laptop and webserver in to communicate.


kansaschuck
02-01-2008, 12:17 AM
For several different application I'm working on I need my Laptop (boardband connected) and a standard ISP served website to exchange data on a regular basis.

For the moment lets work on the Windows XP laptop running the show. I'd like to have a scheduled event kickoff and go get information in an file at a website. Simple text data read every 15 seconds or more.

I've downloaded Perl on to my Windows XP laptop and can open local files and was hoping that Perl could open a remote host file and do the trick by using the Window scheduler.

But I've been reading and looking for some perl code or commands that can, (when executed on the laptop) open/read a file at a standard internet website.

I imagine I just need pointed in the right direction, it can't be too complex cuz I've got three browsers doing it all the time.

Any advice/help is welcome.

Or.... if PHP at the webserver level could push the data down to the laptop I could live with that to.

I'm just have trouble with the 'cross the internet' stuff. Most examples seem to have webserver opening local files and PC opening local files.

Thanks,
KC

Weedpacket
02-01-2008, 04:27 AM
Why not do it in PHP?

Here's a throwaway script I wrote to check something. I ran it from the command line.

<?php
$stuff = new DOMDocument();
@$stuff->loadHTML(file_get_contents('http://www.phpbuilder.com/'));
echo $stuff->getElementsByTagName('title')->item(0)->textContent;
?>

kansaschuck
02-01-2008, 10:36 AM
Why not do it in PHP?

Here's a throwaway script I wrote to check something. I ran it from the command line.

<?php
$stuff = new DOMDocument();
@$stuff->loadHTML(file_get_contents('http://www.phpbuilder.com/'));
echo $stuff->getElementsByTagName('title')->item(0)->textContent;
?>



That's a good start, thanks. I guess that means I need PHP on my laptop. Do you have any recommendations on an install package?

Weedpacket
02-01-2008, 08:14 PM
Do you have any recommendations on an install package?
Download the zip package from www.php.net unzip it somewhere convenient (I just put it in c:\php) Profit!
If you want to get fancy so that you can call it from anywhere without having to specify the path every time you can add it to your environment path. You don't even have to do that yourself; the zip archive provides a .reg file to set those registry keys for you.

I haven't used any of PHP.net's Windows installers - and have a tendency to forget they're there.