Forum Moderators: coopster

Message Too Old, No Replies

Basic Hyperlink Question

         

espressoguy2

2:38 am on Aug 8, 2009 (gmt 0)

10+ Year Member



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.

ashishp

5:30 am on Aug 8, 2009 (gmt 0)

10+ Year Member



I don't think you can manipulate the page in PHP unless you make a script that will fetch the page, process it and show it "on your site".

I think that manipulating html on Google's site will be possible by using firefox, greasemonkey plugin and a greasemonkey script.

Do you want to manipulate it on google or you want to aggregate content on you site?

espressoguy2

6:18 am on Aug 8, 2009 (gmt 0)

10+ Year Member



I want to aggregate the content on my site, process it, and THEN display it to the user.

ashishp

2:32 pm on Aug 9, 2009 (gmt 0)

10+ Year Member



You can then fetch the page using CURL, process it in your php script and display it to the user. See CURL in the php manual.