Finding what it redirects to
I'm using the "Snoopy" class to pick up HTML for phrasing.
The problem is that with one of the pages I need to get the html for redirects automatically because I'm using a the sites search and if it find a perfect result it will redirect.
Here is my snoop:
if($snoopy->fetch("http://www.rottentomatoes.com/search/?search=$pagelink&sitesearch=rt")){
$printable = $snoopy->results;
If the search is exact it will place me on a page like this...
http://www.rottentomatoes.com/m/captain-america/
I need this above link.
Any help would be great,
Thanks开发者_开发技巧!
From poking around in the code a little, it seems like you should be able to check the variable $snoopy->lastredirectaddr
, which should be set if you got redirected (if not, it should be a blank string).
精彩评论