Re: grabbing articles off other sites?
| From: | Chris Moyer | Date: | Wed, 31 May 2000 20:20:34 +0000 |
| Subject: | Re: grabbing articles off other sites? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-761@lists.php.net to get a copy of this message | ||
On Wed, May 31, 2000 at 05:15:57PM -0400, Chris Sano wrote:
> I am trying to develop a portal for Philadelphia Flyer fans where tehy will
> be able to get articles from any site they wish to right on their portal
> page. Is it possible to do a search with PHP, for example, of the NHL page
> on the ESPN site to find any matching keywords, if so, extract the link
> title and the URL and put it in a mysql table?
>
> For example, if there was an article "Lindros signs $8.7 million deal with
> Flyers", and that matched the keyword "Lindros" and "Flyers", can PHP
> extract the title of the article and the URL?
>
Short Answer: Yes
Long Answer: PHP doesn't have a function grap_espn_headlines(). :) You're
going to have to use the file commands to load the target html file into a
variable. Then you will have to use the string, or ereg functions to find
the information from the page that you want, and display it.
It probably makes senses to do this fetching and parseing infrequently
and cache the results on your server...
ALSO: You should probably get ESPN's permission if you are going to be
serving up any of their content.
-- Chris Moyer -- cmoyer@chekinc.com --
PHP Developer -- Chek.com