hey, I wrote moar code

I wanted to see what posts were being shared through Google+.

#!/usr/local/bin/bash
echo "
    " for i in `grep google-plus /var/log/httpd/httpd-access.log | cut -d" " -f7 | sed 's|?share=google-plus-1||g'`; do export URL=http://paulbeard.org$i ; echo -n "
  1. " ; GET $URL | grep \a crank's progress › //g' | sed 's|||g' | cut -d"< " -f1 ; echo "
  2. " done echo "
"

Ugly, I know. Don’t ask how much time I wasted trying to get a regex that would pull the title text from between the title tags. I could use sed to remove text but not match and retain. As the quote runs,

Some people, when confronted with a problem, think
“I know, I’ll use regular expressions.” Now they have two problems.

*sigh*

Leave a Reply

Your email address will not be published. Required fields are marked *