Created
December 5, 2013 02:49
-
-
Save ChimeraCoder/7799402 to your computer and use it in GitHub Desktop.
Read Blogger without Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# how to fetch a blogger.com blog | |
# without the gratuitous javascript | |
# usage: nameofthisfile blog.whatever.com > html_file | |
#! /bin/sh | |
case $# in | |
1) | |
{ | |
a=${1%%/*} | |
printf "%b" "GET / HTTP/1.1\r\n"; | |
printf "Host: ${a##http://}\r\n"; | |
printf "Connection: Close\r\n"; | |
printf "\r\n"; | |
} \ | |
|nc -vv $1 80 \ | |
|sed ' | |
/targetBlogID/!d; | |
s/.*targetBlogID=//; | |
s/&.*//; | |
' \ | |
|while read a | |
do | |
{ | |
printf "%b" "GET /feeds/$a/posts/default HTTP/1.1\r\n"; | |
printf "Host: www.blogger.com\r\n"; | |
printf "Connection: Close\r\n"; | |
printf "\r\n"; | |
} \ | |
|nc -vv www.blogger.com 80 \ | |
|sed ' | |
s/</</g; | |
s/>/>/g; | |
s/&/\&/g; | |
s/"/\"/g; | |
1i\ | |
<br><br> | |
s/<name>/<br><br>name &/g; | |
s/<uri>/<br>uri &/g; | |
s/<generator>/<br>generator &/g; | |
s/<id>/<br>id &/g; | |
s/<published>/<br>published &/g; | |
s/<email>/<br>email &/g; | |
s/<title type=.text.>/<br><br>&/g; | |
s/<openSearch:totalResults>/<br>total results &/g; | |
s/<openSearch:startIndex>/<br>start index &/g; | |
s/<openSearch:itemsPerPage>/<br>items per page &/g; | |
s/<updated>/<br>updated &/g; | |
s/<thr:total>/<br>thr:total &/g; | |
s/<\/feed>/&<br><br><br>/; | |
' | |
done | |
;; | |
*) | |
echo usage: $0 blog.whatever.com >&2 | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment