Alright so I want to use AJAX to run a back end script off the server to grab some text off of another website, then echo that text to the original page.
For example:
Index.php: Starts the AJAX command asking for script.php.
script.php: Opens up (on the server) the webpage (e.g. index2.php) sees the text sends the text back to index.php
Index.php: Then getting the response echos that text.
Possible?
Am I looking at it the wrong way? Should I use a different coding?
EDIT: Take note that index2.php would be on a server that is not controlled by I. i.e. Google.com
AJAX / PHP Text Grabber
Moderator: General Moderators
Re: AJAX / PHP Text Grabber
There are plenty of screen scraping programs out there, also look up how to use CURL statements to read pages from another website or file get contents too I think. Google recommends you use their API to obtain their search results (if thats what you are doing...?)
-
QuickSnail
- Forum Commoner
- Posts: 46
- Joined: Fri Dec 21, 2007 11:13 am
Re: AJAX / PHP Text Grabber
Ok cool thanks.
Naw I'm not using it for search results. I have a personal homepage I use for all my computers and I wanted to get stock updates off of google.
EDIT: Thank you so much! Curl worked perfectly! Had to fine tune the substr strings a bit but worked great!
Naw I'm not using it for search results. I have a personal homepage I use for all my computers and I wanted to get stock updates off of google.
EDIT: Thank you so much! Curl worked perfectly! Had to fine tune the substr strings a bit but worked great!