Skip to content

Instantly share code, notes, and snippets.

@jq2
Created January 11, 2018 03:03
Show Gist options
  • Save jq2/7ca951a8887a14e9dda61606c0e859c5 to your computer and use it in GitHub Desktop.
Save jq2/7ca951a8887a14e9dda61606c0e859c5 to your computer and use it in GitHub Desktop.
Download a list of proxy servers from https://free-proxy-list.net
#!/bin/bash
# @filename: parse_free_proxy_list_net.sh
# @author: NullDotDEV
# @description: Download a list of proxy servers from https://free-proxy-list.net
# @last-updated: Thu Jan 11 00:49:31 -02 2018
# ===============================================================================
# HowTo: Using this script.
# Using this script is very simple, just type:
# Example: $ ./parse_free_proxy_list_net.sh > list_of_ips.txt
# download
curl -L --user-agent "Mozilla/6.0" "https://free-proxy-list.net" &> dataset.txt
# loop through the html source-code and print all the IP addresses to standard output.
for idx in {1..300};
do
ip_address=$(cat dataset.txt | pup "#proxylisttable > tbody > tr:nth-child($idx) > td:nth-child(1) text{}");
port_number=$(cat dataset.txt | pup "#proxylisttable > tbody > tr:nth-child($idx) > td:nth-child(2) text{}");
echo "$ip_address:$port_number";
done
@jq2
Copy link
Author

jq2 commented Jan 26, 2018

Outra versão do filtro/parser:

#!/bin/bash
IFS=$'\n';

let counter_a=7;
let counter_b=7;

for line in $(cat dataset.txt);
do
	((counter_a++));
	if [[ $(( $counter_a % 8 )) == 0 ]];
	then
		ip_address="$line";
	fi;
	if [[ $(( $counter_b % 8 )) == 0 ]];
	then
		port_number="$line";
		counter_b=0;
		echo "IP: $ip_address - PORT: $port_number";
	fi;
	((counter_b++));
done

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