Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imgdragon.com #123

Open
derbenx opened this issue Sep 8, 2016 · 0 comments
Open

imgdragon.com #123

derbenx opened this issue Sep 8, 2016 · 0 comments

Comments

@derbenx
Copy link
Contributor

derbenx commented Sep 8, 2016

This code seems like it should submit the right variables, I checked against the website source, but it doesn't seem to work. I don't quite understand how this works yet, not enough to see what needs fixing anyway.

It just says <error>, here in an url to test; http://imgdragon.com/s1z8tylem574/068bu_040.jpg.html

{ "type": "sandbox", "prefix": "imgdragon.com", "match": "^http://(www.)?imgdragon\\.com/[\\d\\w]+/.+\\.html", "process": "\"use strict\";\nvar http = new XMLHttpRequest();\nvar url = baseURL;\nvar p1 = new RegExp(\"\\.com/(.+)/\");\nvar m1 = p1.exec(baseURL);\nvar params = \"op=view&id=\"+m1[1]+\"&pre=1&adb=0&next=Continue+to+image...\";\nhttp.open(\"POST\", url, true);\nhttp.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\nhttp.setRequestHeader(\"Content-Length\", params.length);\nhttp.onload = function() {\n\tvar p = new RegExp(\"src=\\\"(.+?)\\\" class=\\\"pic\\\" alt=\\\"(.+?)\\\"\");\n\tvar m = p.exec(http.responseText);\n\tif (m && m.length >= 3) {\n\t\tsetURL(m[1],m[2]);\n\t}\n\telse {\n\t\tmarkGone();\n\t}\n\tfinish();\n};\nhttp.onerror = function() {\n\tmarkGone();\n\tfinish();\n};\nhttp.send(params);\n" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant