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 "- " ; GET $URL | grep \
a crank's progress › //g' | sed 's| ||g' | cut -d"< " -f1 ; echo " "
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*