diff options
author | epochqwert <epoch@hacking.allowed.org> | 2015-04-21 13:41:40 -0500 |
---|---|---|
committer | epochqwert <epoch@hacking.allowed.org> | 2015-04-21 13:41:40 -0500 |
commit | 318b3220d191011bb9132efd4dbd5e6fb467b4e7 (patch) | |
tree | 1b0e7a29d15f79743c8559652432658423046a38 /nocompile/bin/tpb.sh | |
parent | 4bdfc44f4681ef322378e614a409d5acc4d6586c (diff) | |
download | misc-318b3220d191011bb9132efd4dbd5e6fb467b4e7.tar.gz misc-318b3220d191011bb9132efd4dbd5e6fb467b4e7.zip |
made dcchelper a script instead of a c program.
ipdist which gives shortest distance based on whob's output of lat and lon
nc.* are minmal versions of a netcat like program written in Perl.
rfc is a script for downloading and viewing RFCs
tpb.sh is for pulling magnet links from tpb search results.
cuturl got an upgrade to better handle scheme:?query_string type URLs. (URN? URI? fuck if I know.)
Diffstat (limited to 'nocompile/bin/tpb.sh')
-rwxr-xr-x | nocompile/bin/tpb.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/nocompile/bin/tpb.sh b/nocompile/bin/tpb.sh new file mode 100755 index 0000000..7162b21 --- /dev/null +++ b/nocompile/bin/tpb.sh @@ -0,0 +1,36 @@ +#!/bin/sh +#get magnets based on search. easy. :P +if [ "_$1" = "_" ];then + echo usage: tpb.sh search_term [category] [limit] + echo "categories:" + echo "0 = any" + echo "100 = audio" + echo "200 = video" + echo "300 = applications" + echo "400 = games" + echo "500 = porn" + +else + if [ "_$2" = "_" ];then + cat=0 + else + cat="$2" + fi + if [ "_$3" = "_" ];then + lim=5 + else + lim="$3" + fi +#last number: +#0 = any +#100 = audio +#200 = video +#300 = applications +#400 = games +#500 = porn + wget -qO- 'https://thepiratebay.se/search/'"$1"'/0/99/'"$cat" \ + | tr '"' "\n" \ + | grep ^magnet \ + | decode_html_entities \ + | head -n "$lim" +fi |