ImageHost Grabber Forum
September 09, 2010, 02:22:46 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Some changes have been made to the forum.  Please take note of the new topic areas and post accordingly.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: MyPublicPix change to Imagearn?  (Read 812 times)
bdog
Newbie
*
Posts: 1


View Profile
« on: February 08, 2010, 10:12:57 AM »

is it possible to get the new image from mypublicpix links? they forward to imagearn.  thanks

http://www3.mypublicpix.com/index.php?img=1238794485_IMG_12.jpg
Logged
imagedawg
Jr. Member
**
Posts: 66


View Profile
« Reply #1 on: February 09, 2010, 05:08:59 PM »

There doesn't seem to be an independent MyPublicPix website.  It automatically redirects to www.imagearn.com.  Just get your galleries from the imagearn website and IHG should work okay.
Logged
cybormatt
Administrator
Sr. Member
*****
Posts: 271


View Profile
« Reply #2 on: February 10, 2010, 03:31:43 AM »

Do you have a gallery of "mypublicpix" images, for example, a thread where someone posted a bunch of pics that were hosted on "mypublicpix"Huh  I could possibly make a work-around for the re-direction.

Matt
Logged
zephyrprime
Newbie
*
Posts: 7


View Profile
« Reply #3 on: May 09, 2010, 10:36:06 AM »

Here's just such a gallery: http://forum.anothersite.co.uk/nsfw-amateur-pics/176197-amateur-lesbians-32.html

Please note that this issue actually involves a double redirection.  

The original URL is:
http://www3.mypublicpix.com/index.php?img=1238633517_1233848074_amateurbumps.com_20090205_03_021.jpg

and it redirects to:

http://www.imagearn.com/imagearn.php?img=1238633517_1233848074_amateurbumps.com_20090205_03_021.jpg

which in turn redirects to:
http://imagearn.com/image.php?id=823673

I worked on it a little bit and came up with the following but it still doesn't work.  Not sure what the problem is:

Code:
<host id="mypublicpix">
<urlpattern>^http:\/\/www\d*\.mypublicpix\.com\/index\.php\?img=.+</urlpattern>
<searchpattern><![CDATA[function(pageData, pageUrl) {
var retVal = new Object();

retVal.imgUrl = pageUrl.replace(/(http:\/\/www\d*\.mypublicpix\.com\/index\.php)(.+)/, "http://imagearn.com/imagearn.php$2");
retVal.status = "REQUEUE";

return retVal;
}]]></searchpattern>
</host>
Logged
zephyrprime
Newbie
*
Posts: 7


View Profile
« Reply #4 on: May 09, 2010, 11:36:13 AM »

Ah!  I got it!

This was very tricky.  The basic way this works is to first write out a new url pattern for the new site.  This gets us past the first redirect.  The second redirect was trickier.  I had to start up an AJAX request to get the second URL.  Then I had to read the header response in the second page to get the third url.  Then the third url is requeued.

mypublicpix.com seems to now be entirely defunct so this new search pattern might as well replace the existing one.

Code:
<host id="mypublicpix">
<urlpattern>^http:\/\/www\d*\.mypublicpix\.com\/index\.php\?img=.+</urlpattern>
<searchpattern><![CDATA[function(pageData, pageUrl) {
var retVal = new Object();
var newUrl;
var req = new XMLHttpRequest()

newUrl = pageUrl.replace(/(http:\/\/www\d*\.mypublicpix\.com\/index\.php)(.+)/, "http://imagearn.com/imagearn.php$2");

req.open("GET", newUrl, false);
req.send(null);

newUrl = req.getResponseHeader("refresh");
newUrl = newUrl.match(/url=(http:\/\/[^:"'<>]+)/i);

if (!newUrl)
{
retVal.imgUrl = null;
retVal.status = "ABORT";
}
else
{
retVal.imgUrl = newUrl[1];
retVal.status = "REQUEUE";
}

return retVal;
}]]></searchpattern>
</host>
Logged
cybormatt
Administrator
Sr. Member
*****
Posts: 271


View Profile
« Reply #5 on: May 09, 2010, 11:43:43 PM »

Bravo Zeph!  I am truly impressed with the use of AJAX!  Now that is thinking out of the box and I like that!  I hope to see more of your work around.
Logged
zephyrprime
Newbie
*
Posts: 7


View Profile
« Reply #6 on: May 10, 2010, 09:56:00 PM »

Thanks.  I struggled with that for hours before I tried to read the http header with ajax.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!