Hacker News new | comments | show | ask | jobs | submit login

Is this like the first time you've read a Blogger blog in years? Google mandated the Javascript nonsense quite some time ago.

Because I feel your pain, I wrote you a quick, dirty fix.

  # 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



Thank you very much. Your script does the trick. I was able to read the blog without enabling JavaScript for that site.


You're most welcome. What OS are you using?




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: