Skip to content

Instantly share code, notes, and snippets.

@yesmar
Last active January 27, 2018 01:07
Show Gist options
  • Save yesmar/22f5bb34ab4ae4cd47e94c59fefb0eab to your computer and use it in GitHub Desktop.
Save yesmar/22f5bb34ab4ae4cd47e94c59fefb0eab to your computer and use it in GitHub Desktop.
Generate random User Agent
const fs = require('fs');
const ua = fs.readFileSync('ua.txt').toString().split("\n"),
agent = ua[Math.floor(Math.random()*ua.length)];
console.log(agent);
@yesmar
Copy link
Author

yesmar commented Jan 26, 2018

If you clone this repo, run these commands to pull down and ignore ua.txt:

curl -#LO https://raw.githubusercontent.com/jgamblin/curluseragent/master/ua.txt && echo ua.txt >> .git/info/exclude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment