Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

woods

macrumors newbie
Original poster
Jul 6, 2006
20
0
So I spent today working on getting a growl notification for people that view my AIM profile. I'm sure this will work on any other online messenger profile too.

The only way to detect when someone views your profile is when they actually click a link. So what I did was found a way to get a notification when they click a link in my profile. This isn't totally usefull, but it is kind of cool because you get to see the screen name of the person clicking links in your profile.

There exist php scripts to do this... 3 years ago "SubProfile" was a popular php implementation that allowed AIM uses to do extracurricular stuff with their profiles...logging those who view your profile was one of them.

So I started there...looking for a good and simple php script that would log who visited my profile. I started thinking that i'd simply parse unnecessary information from the log and run a cron job to look for new entries in the log. The problem with something like this is that it is totally inefficient.

The AIM click logging script I settled on was Protcher

So I looked around and I found different variations of network growling scripts. I found a perl implementation and then finally found one written in php. The current version of growl accepts network growls, meaning notifications sent from another computer.

I settled on PEAR::Net_Growl for sending network growl notifications.

This php script bascially takes an IP address and password and depedning on how you call the script it will send a notification from a webserver to your computer when you visit the location of the php on the wesbite. For example, http://www.examplesite.com/hello.php, would send a notification to my computer when I went to that url. This is usefull because instead of making a separate php file (like the hello.php above), I simply embedded a call to the net_growl in the aim click logger php script protcher.

So I added 4 lines of code to the AIM logger script Protcher, and just like that when someone clicks the profile link I get an instant growl notification with their screen name telling me they clicked that link.



aimspy.jpg


Overall the tricky part was getting PEAR::Net_Growl to work on my webhost. If you pay for hosting they do not allow you to just install foreign php stuff in /usr/lib/php. Dreamhost, my host, had a great wiki on how to work around this. The entire process takes one php script (an edited version of Protcher, and the installation of PEAR::Net_Growl (edit the IP Address to send growl to, your ip address, edit the password which you set in the growl preference pane...these edits need to be made in Growl.php which comes with PEAR::Net_Growl) If you have a router you need to forward the network growl udp port 9887 so that when it sends to your ip address it will arrive at the correct computer.

Overall I think there are more uses for this than an instant messenger profile. I have done the same thing for a link in my myspace profile....While I do not know which myspace user is clicking the link, I get a notification when someone looking at my myspace page does click the link...This kind of gives me an idea of how many people are actually clicking the link on my myspace page.

I'm still looking forward to messaging someone like a second after they click the link in my profile and confront them about it...with them saying something like, "how the hell did you know I just clicked that?"

I'm sure other people can think of other uses. I thought I'd contrinute this to the growl community, as I hadn't found anything like it via Google.

I did not write any code in these open source scripts, I just put them together. The credit goes to the original authors.

Feel free to email me with questions or suggestions.

timbergeron@gmail.com
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.