Skip to content

Instantly share code, notes, and snippets.

@VitalyKondratiev
Created January 30, 2019 16:26
Show Gist options
  • Save VitalyKondratiev/379216893fd33dcdc87152463a384fbe to your computer and use it in GitHub Desktop.
Save VitalyKondratiev/379216893fd33dcdc87152463a384fbe to your computer and use it in GitHub Desktop.
Getting list of working proxies on Node.js (node module, promise)
const osmosis = require('osmosis');
module.exports = function () {
return new Promise(function (resolve, reject) {
let proxies = [];
osmosis
.get('https://free-proxy-list.com/?search=1&up_time=60')
.find('.proxy-list tbody tr td:first-child a')
.set({ 'data': '@title' })
.error(error => reject(proxies))
.data(data => proxies.push(data.data))
.then(event => {
if (event.last) resolve(proxies);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment