Re: getting data back from another website
| From: | Kevin Stone | Date: | Tue, 20 May 2003 21:01:32 +0000 |
| Subject: | Re: getting data back from another website | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148325@lists.php.net to get a copy of this message | ||
Remote queries and page scraping are both common practices. You can find a
lot of information on both techniques by searching Google Groups. Just make
sure you have permission from the website before hand. You want to make
sure you're not infringing on their terms of service.
- Kevin
----- Original Message -----
From: "Hugh Danaher" <hdanaher@earthlink.net>
To: "Nigel Hagger-Vaughan" <nigelhv@bigfoot.com>
Cc: <php-general@lists.php.net>
Sent: Tuesday, May 20, 2003 1:49 PM
Subject: Re: [PHP] getting data back from another website
> Nigel,
> if you have a list of the domain names then you should be able to do
> something like:
>
> $domain_name="wilden.worcs.sch.uk"; // this is the domain name from your
> list
> $file_to_open="x6Ûb49
> n±Ëzú~�http://cgi.nic.uk/cgi-bin/whois.cgi?query=".$domain_name;
> $fp=fopen($file_to_open,"r");
> while(!feof($fp))
> {
> $line=fgets($fp,100); // reads a line of text or 100 characters which ever
> comes first
> if (preg_match("/Name servers listed in order:/",$line)
> {
> while (!preg_match("/WHOIS/",$line))
> {
> $line.=fgets($fp,100);
> }
> }
> }
> echo $line;
> fclose($fp);
>
> ----- Original Message -----
> From: "Nigel Hagger-Vaughan" <nigelhv@bigfoot.com>
> To: <php-general@lists.php.net>
> Sent: Monday, May 19, 2003 12:32 PM
> Subject: [PHP] getting data back from another website
>
>
> > I'm sure there's a simple solution to this. In my site, I want to be
able
> > to send a query to another website, get some information from it and
store
> > it on my own, and I don't have a clue how to go about it. So that you
> know
> > what I'm talking about, I'll tell you - my site supports about 300
schools
> > in the UK. For each of the schools, I want to be able to get
information
> > from the Nominet website (www.nominet.net) to find out the ISP tag that
is
> > associated with their domain name. The URL will to pull up the
> appropriate
> > page will look something like this:
> >
> >
> > http://cgi.nic.uk/cgi-bin/whois.cgi?query=wilden.worcs.sch.uk
> >
> > for a school with a domain name wilden.worcs.sch.uk. I've got a
database
> of
> > domain names, so I want to be able to create the URL, send it off
> (somehow)
> > and (somehow) process the result, which is (in this case) BTNAMES, as
you
> > will see from the Nominet site. Can anyone point me in the general
> > direction of how to do this?
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>