diff options
Diffstat (limited to 'init.js')
-rw-r--r-- | init.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -33,6 +33,10 @@ module.exports.search = (query, userAgent = "Mozilla/5.0 (X11; Ubuntu; Linux x86 })) .filter(elem => elem) ) + +module.exports.searchRandom = (query, userAgent) => module.exports.search(query, userAgent) + .then(results => results[Math.floor(Math.random() * results.length)) + /* In case google makes changes, here are some snippets used to reverse engineer the format: |