Created
November 17, 2012 15:26
-
-
Save norganna/4096777 to your computer and use it in GitHub Desktop.
spiderable patch to reattach hash fragment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- spiderable.js.orig 2012-11-18 01:14:08.000000000 +1000 | |
+++ spiderable.js 2012-11-18 01:16:08.000000000 +1000 | |
@@ -14,10 +14,11 @@ | |
var preQuery = req.url.substr(0, idx); | |
var queryStr = req.url.substr(idx + 1); | |
var parsed = querystring.parse(queryStr); | |
+ var fragment = '#!' + parsed['_escaped_fragment_']; | |
delete parsed['_escaped_fragment_']; | |
var newQuery = querystring.stringify(parsed); | |
var newPath = preQuery + (newQuery ? "?" + newQuery : ""); | |
- var url = "http://" + req.headers.host + newPath; | |
+ var url = "http://" + req.headers.host + newPath + fragment; | |
// run phantomjs | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment