Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made a CLI based on your work #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
HMA-Proxy-Scraper
=================
# Prox Please

Uses node.js to pull/parse working http proxies from Hidemyass.com
Download the list of proxies on Hidemyass.com straight to stdout.

Runs callback function on completion. Input miscellaneous ops iterating the proxies here in order to switch proxies on each request (eg. changing your ip address on each request).
### Usage

Output in the form of key:value --> IP : Port.
![Usage](./usage.gif)

```bash
proxplease
```
{
'202.118.236.130' : '3128',
'111.11.27.194' : '80',
'183.136.221.6' : '3128',
'183.207.228.58' : '80',
'190.106.66.178' : '3128',
'61.55.141.10' : '81',
'124.67.215.9' : '80',
...etc
}

### Installation

```bash
npm install -g proxplease
```

### Notes

Proxease is a thin wrapper around HMA-Proxy-Scraper to make it easier to use. Since that library is not in npm, I forked and used it. 100% credit to the original author.

17 changes: 17 additions & 0 deletions bin/proxplease.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /usr/bin/env node

/**
* Created by Ran on 15-Sep-15.
*/
var hma = require('../scraper');
var Spinner = require('clui').Spinner;

var spinner = new Spinner('Fetching');
spinner.start();

hma.getProxies(function (proxies) {
spinner.stop()
console.log(proxies.join(require('os').EOL));
}, function (error) {
console.error("An error occurred: " + error);
});
10 changes: 0 additions & 10 deletions example.js

This file was deleted.

26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
{
"name": "HMA-Proxy-Scraper",
"version": "1.0.0",
"description": "HMA-Proxy-Scraper\r =================",
"main": "scraper.js",
"name": "proxplease",
"version": "0.0.1",
"description": "Easily download the latest ip:port proxies from HideMyAss",
"dependencies": {
"clui": "^0.3.1",
"request": "^2.62.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"contributors": [
"sdrobs wrote it, I just put some stuff around it"
],
"repository": {
"type": "git",
"url": "https://github.com/sdrobs/HMA-Proxy-Scraper.git"
"url": "https://github.com/corydolphin/HMA-Proxy-Scraper.git"
},
"author": "",
"author": "Cory Dolphin",
"license": "ISC",
"bugs": {
"url": "https://github.com/sdrobs/HMA-Proxy-Scraper/issues"
"url": "https://github.com/corydolphin/HMA-Proxy-Scraper/issues"
},
"homepage": "https://github.com/sdrobs/HMA-Proxy-Scraper"
"homepage": "https://github.com/corydolphin/HMA-Proxy-Scraper",
"bin": {
"proxplease": "bin/proxplease.js"
}
}
7 changes: 2 additions & 5 deletions scraper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var request = require('request');
var getProxies = function (successCallback, errorCallback, pageNum, proxiesScraped) {

if (!proxiesScraped) {
proxiesScraped = {};
proxiesScraped = [];
}

if (!pageNum){
Expand Down Expand Up @@ -63,12 +63,9 @@ var getProxies = function (successCallback, errorCallback, pageNum, proxiesScrap
for (var i = 0; i < ips.length; i++) {
if (types[i] == 'HTTP' || types[i] == 'HTTPS') {
count++;
proxiesScraped[ips[i]] = ports[i]
proxiesScraped.push(ips[i] + ':' + ports[i])
}
}

console.log('collected ' + count + ' http proxies from page ' + pageNum);

getProxies(successCallback, errorCallback, pageNum + 1, proxiesScraped)
}
else {
Expand Down
Binary file added usage.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.