Skip to content

Instantly share code, notes, and snippets.

@ChimeraCoder
Created December 5, 2013 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChimeraCoder/7799402 to your computer and use it in GitHub Desktop.
Save ChimeraCoder/7799402 to your computer and use it in GitHub Desktop.
Read Blogger without Javascript
# 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/&lt;/</g;
s/&gt;/>/g;
s/&amp;/\&/g;
s/&quot;/\"/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