Created
December 15, 2013 16:04
-
-
Save photopresentr/7974747 to your computer and use it in GitHub Desktop.
Convert HAR Archive to Siege URL List using node.js
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
#!/usr/bin/env node | |
/* | |
* har2siege.js | |
* converts a HAR file generated by chrome to an url file as required | |
* by the siege performance testing tool (http://www.joedog.org/siege-home/) | |
* | |
* Usage: | |
* - save har file in chrome. make sure extension is .json, e.g. myrequests.json | |
* - put the relative path as the only parameter on the command line | |
* - redirect STDOUT to the file you want as the urllist for siege | |
* | |
* Example: ./har2siege.js ./myrequests.json > ./urllist.txt | |
*/ | |
var har = require(process.argv[2]); | |
var _ = require('underscore'); | |
process.stdout.write( | |
_.map(har.log.entries, function(entry) { | |
return entry.request.url + | |
(entry.request.method =='POST' ? ' POST ' + entry.request.postData.text : ''); | |
}).join('\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi.
I made an alternate Version to not use underscore .. https://gist.github.com/kuddl/5a3104b2c6e66839cf69
Thanks for your initial work!
Tobias