Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
User Journal

Journal AntiFreeze's Journal: slashfans.sh 3

This is for all you ego-maniacs out there who want to keep track of your fans:

#!/bin/bash

if [ x$1 != x ]; then
echo -n "$1's Slashdot Fans:"
lynx -dump http://slashdot.org/~$1/fans/ | grep friends\ | wc -l
else
echo -n "AntiFreeze's Slashdot Fans:"
lynx -dump http://slashdot.org/~AntiFreeze/fans/ | awk ' /\].*\(.*friends.*fans/ { gsub(/\[[^\]]*\]/, "") ; gsub(/\(.*/, "") ; print }' > fans.tmp
wc -l fans.tmp
diff fans.lst fans.tmp
mv fans.lst fans.old
mv fans.tmp fans.lst
fi

Now just edit to your heart's content to keep track of your friends or foes or freaks.

Self explanatory, but what the hell? It'll print out the number of fans, and alert you to any new fans or people who removed themselves from your fans list (as both Claudia and LadyGuardian just did to me :[ ). If you call it with a name (./slashfans.sh gmhowell) it'll tell you how many fans George has. Perfect for tracking and comparing your status to that of others.

Happy egoing.

---

P.S. Sorry if it's a little hard to read, I couldn't get the spacing right.

P.P.S. In line 4 (the lynx -dump line), friends\ is the same as "friends ", namely, the word friends with a space after it. That space is _important_.

P.P.P.S. The second lynx -dump line goes _all_ the way until "> fans.tmp", do not truncate it like slashdot has.

This discussion has been archived. No new comments can be posted.

slashfans.sh

Comments Filter:
  • as I noted in my journal, there's been some weirdness in the zoo today. for one, if I try to modify my relationship to anyone, I just get an apache error. also, it appears that a bunch of people that I'd previously marked as friends suddenly became "unfriended" today.... (and one person dropped off my fans list.) strange things are afoot....
  • open-source slashcode--awesome!

"It says he made us all to be just like him. So if we're dumb, then god is dumb, and maybe even a little ugly on the side." -- Frank Zappa

Working...