?

Log in

No account? Create an account
LJ Friends Checker (perl) - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

LJ Friends Checker (perl) [Aug. 2nd, 2002|12:21 am]
LiveJournal Client Discussions

lj_clients

[gharris]
[mood |satisfiedsatisfied]
[music |Soundtracks - Angelo Badalamenti - Haunting & Heartbreaking]

I typically check lj from work over a telnet connection, and have been thinking about a way to have an alert when my friends page is updated. The other day I found the 'checkfriends' mode, and whipped up this little perl script. Its pretty simple in its operation and featureset, but it fits the bill.

It is written in Perl, and requires:
Term::ReadKey
HTML::Entities
Digest::MD5

It does:
Checks livejournal.com for updates to your friends page (using the quick-n-easy 'checkfriends' mode)
Continues polling until an update is found, then waits for you to tell it to start again.
When an update is found, it 'dings' the terminal.
You can, using '0' as the only commandline option, tell it not to poll, but only to check for updates once.

To provide login information, you can either edit the source file, and plug your information into the blanks, or do nothing and it will prompt you for your login information.

This was designed to be used inside a GNU Screen window, where the ding will flash the window and put a little '!' next to the windowname to let you know there is activity. It is GPL'd and therefore free.

Get it here!

Enjoy!
linkReply

Comments:
[User Picture]From: archon
2002-08-01 11:18 pm (UTC)
hey, that sounds familiar (=
(Reply) (Thread)
[User Picture]From: gharris
2002-08-01 11:35 pm (UTC)
dangit! where did you find that? I looked all through the 'download' area and briefly through the developer's area (which seemed to only have the docs I was looking for).

hehe, oh well, I learned about the lj protocol thing in the process =)

--Glenn
(Reply) (Parent) (Thread)
[User Picture]From: archon
2002-08-01 11:49 pm (UTC)
hehe.. i wrote it

i just checked and that area isn't even directly linked anymore. you'd have to go through the developer's area and follow the livejournal code repository link, and then go up a directory etc.. i guess that whole area isn't really supported anymore.

nothing wrong with reinventing the wheel if you learn something, though.
(Reply) (Parent) (Thread)
[User Picture]From: gharris
2002-08-02 12:00 am (UTC)
yeah, I noticed your name in it =)
I take it you also wrote the 'LiveJournal' module (perl)?
Just from looking at you cf code, I am guessing it takes care of all the chatting with the lj servers? I suppose I could peek at it myself.. maybe I'll pore through it tomorrow while I'm at work.

Thanks for the pointer to that directory, some nice stuff in there.

--Glenn
(Reply) (Parent) (Thread)
[User Picture]From: archon
2002-08-02 12:12 am (UTC)
yep, i wrote the module and yep, it takes care of the chatting.. i'd like to update it with some patches but i can't access it anymore. i should become less lazy and put them up somewhere soon. i should also check to make sure they haven't added to the protocol (=
(Reply) (Parent) (Thread)
[User Picture]From: jerronimo
2002-08-02 05:26 am (UTC)
same here. my client has gotten the checkfriends info for at least the past 8 months or so.

(And it doesn't require any of the libraries you mentioned...)
(Reply) (Parent) (Thread)
[User Picture]From: gharris
2002-08-02 06:39 am (UTC)
heh, that's interesting. I use jlj for all my posting needs =) And I never realized it had the 'checkfriends' feature... though, it was probably more that I didn't know what it was so ignored it... but it doesn't loop or ding the terminal =P

--Glenn
(Reply) (Parent) (Thread)
[User Picture]From: jerronimo
2002-08-02 06:44 am (UTC)
nope. it was meant to be used as a part of a shell script or another perl script. I believe that tools should be atomic, and not monolithic.
JLJ just retrieves the information and makes it easy to get those values into another script where you can have it loop or ding the terminal or something...

something like that was such a simple solution that I never bothered to include it along with JLJ, although perhaps now I will. heh.
(Reply) (Parent) (Thread)
[User Picture]From: gharris
2002-08-02 07:35 am (UTC)
I was more trying to make a joke than to suggest your script was lacking because of some specific 'feature'...
I do agree with the atomic idea, and whole-heartedly support it, which is why I decided to write a seperate script which specializes in the 'checkfriends' thing... had I known yours did the checkfriends function, I would have just written a looping wrapper...
anyway... oh, and thanks for jlj btw, 'is vewy niice'

--Glenn
(Reply) (Parent) (Thread)
[User Picture]From: theorb
2002-08-04 11:42 pm (UTC)
BTW, it appears that checkfriends doesn't alert you as to new comments appearing under existing entries. Is my observation correct? Should it? How dificult would that be to change? How much additional load would it generate? Should I be asking in lj_dev?

I've just started developing my own checkfriends client. It's eventualy slated to be a gnome applet.
(Reply) (Thread)
[User Picture]From: gharris
2002-08-06 01:08 pm (UTC)
As far as I know, right now there is no way to get a count of comments for an entry. That would be nice though. I'd say you'd be better off asking this question in lj_dev.

--Glenn
(Reply) (Parent) (Thread)