View Single Post
Old June 13th, 2017, 12:45 PM   #21
effCup
Vintage Idiot
 
effCup's Avatar
 
Join Date: Feb 2012
Location: History
Posts: 22,136
Thanks: 226,721
Thanked 356,752 Times in 21,631 Posts
effCup 1000000+effCup 1000000+effCup 1000000+effCup 1000000+effCup 1000000+effCup 1000000+effCup 1000000+effCup 1000000+effCup 1000000+effCup 1000000+effCup 1000000+
Default

Pimp & host:

Host Label: pimpandhost
URL Pattern: ^https?:\/\/(?:image\.|www\.)?pimpandhost\.com\/image\/.+?$
Code:
function(pageData, pageUrl) {
	var iUrl = pageData.match(/img class="normal" src="(https?:\/\/.+?)(_l)?(\.(jpe?g|png|JPE?G|PNG))"/);
	return iUrl ? {imgUrl:  iUrl[1] + iUrl[3], status: "OK"} : {imgUrl: null, status: "ABORT"}
}
edit: to explain the above: the purpose is to get the full-size image from P&H, rather than the reduced-size image that is often what's first linked.

edit 2: doesn't currently work for gifs but would be easy to amend to include. Does P&H take gifs? It's a poor option to have to wrangle with the image file suffix but that's pretty helpful for locating the "_l" that we want to remove in order to get the full-size image, so: swings/seesaws.

If people need this for gifs on P&H then let me know.

Last edited by effCup; June 14th, 2017 at 11:51 AM.. Reason: expl.; 2
effCup is offline   Reply With Quote
The Following 12 Users Say Thank You to effCup For This Useful Post: