Skip to content

Instantly share code, notes, and snippets.

@tklam
Created December 11, 2019 03:49
Show Gist options
  • Save tklam/5816b6c0fc07a36e53e1a1640f42cfd2 to your computer and use it in GitHub Desktop.
Save tklam/5816b6c0fc07a36e53e1a1640f42cfd2 to your computer and use it in GitHub Desktop.
#!/bin/sh
# A simple webpage snapshot tool
# Try to get a free proxy, and then wget a webpage via the proxy
for ((;;))
do
wget https://free-proxy-list.net/anonymous-proxy.html -O proxy.html
proxy=$(grep '<td>[0-9\.]\+</td>' proxy.html | sed -e 's,.*<td>\([0-9\.]*\)</td><td>\([0-9]\+\)</td>.*,\1:\2,' | head -n 1)
#echo "proxy is $proxy"
wget --connect-timeout=1 -e use_proxy=yes -e http_proxy=$proxy -e https_proxy=$proxy <a URL of a webpage>
sleep 30
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment