View Single Post
Old July 17th, 2017, 09:46 AM   #50
effCup
Vintage Idiot
 
effCup's Avatar
 
Join Date: Feb 2012
Location: History
Posts: 22,136
Thanks: 226,731
Thanked 356,784 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

Quote:
Originally Posted by berangus View Post
Super, glad I could help out! Big thanks for this new code, it works aces although it required a tiny fix - guess I know a little about this stuff after all. In the first line of the function there's a single quotation where it should be a double: src=("|") instead of src=('|"). So the whole thing becomes thus:

Host Label: pixxxels
URL Pattern: ^https?:\/\/(?:s\d+\.)?pixxxels\.org\/image\/.+$
Search Pattern:
Code:
function(pageData, pageUrl) {
    var iUrl = pageData.match(/src=("|")(https?:\/\/s\d+\.pixxxels\.org\/.+?\.jpg)\1/);
    return iUrl ? {imgUrl: iUrl[2] + "?dl=1", status: "OK"} : {imgUrl: null, status: "ABORT"}
}
No. What you've done there is change it from handling either single or double quotes, to only handling double quotes. The parens. denote a group. Inside it are options, separated by the pipe sign. You're saying: either double-quote or double-quote. It should be left as it was: either single-quote or double-quote.
effCup is offline   Reply With Quote
The Following 8 Users Say Thank You to effCup For This Useful Post: