View Full Version : Basic Hyperlink Question

08-07-2009, 07:17 PM
Not sure if this is the right place to be asking a question like this ...but here we go... It's a fundamental question:

When a user clicks a hyperlink in a web page, is there a way for me to pre-process that page before displaying it in the web browser to them?

Here's the application: I get a google news page that says "Click here to see 700 news articles about this subject". Now the incoming page has articles from newspapers I really don't care about. So I'd like to manipulate that page in PHP before displaying it back to the browser so that the 675 articles I'm not interested in can be eliminated while only the 25 articles I'm interested in are displayed.

I can handle the manipulation of the text in php. What I can't think of is a way to get the incoming page back into my script before it is displayed back to the browser. Any help would be appreciated.

08-08-2009, 07:19 AM
Are you talking about the RSS feed from Google News (http://news.google.com/news?pz=1&ned=us&hl=en&output=rss)? If so then you might want to have a look at Magpie (http://magpierss.sourceforge.net/). This program fetches an RSS feed and then lets you manipulate it before you display it. You would then need to examine the RSS feed to see what information the $rss->items array contains that you could filter to get the results you wanted.