iChatStatusPublisher
Posted on August 09, 2004 at 11:15 PM EST
Description
iChatStatusPublisher is a stay-open script application that enables you to make your site more interactive by displaying your current iChat status. When you’re available, it will display a hyperlink that your visitors can click on to send you an instant message.
Requirements
- Mac OS X 10.1 or higher
- iChat AV
Installation
Download the script.
Create a new folder named “iChat” in your user’s Library folder (/Users/USERNAME/Library/iChat).
Open the Script Editor which is located in the AppleScript directory inside your system’s Applications folder (/Applications/AppleScript/Script Editor).
Copy and paste AppleScript code into the top box of the Script Editor.
Edit the config variables at the top of the script and enter the appropriate information. I recommend using the SCP option as it is a more secure method of transferring files. If your web host does not support connections via SSH then you’ll need to use FTP. In this case I recommend creating an additional FTP account that just has access to a sub-folder on your account to help minimize security risks.
-
Click “File” then “Save As…” and a dialog box will appear (see below).

Save the file as “iChatStatusPublisher” and save it to your system’s Applications folder.
Select “Application” from the File Format drop-down menu.
Check the option to “Stay Open”. This will keep the script running in the background so it can communicate with iChat.
Go to your Applications folder and double click on the icon for “iChatStatusPublisher” to run the script. You may also want to create an alias to the script and save it to your Desktop.
Copy the PHP code and paste it where you would like the iChat status to appear on your webpage. This file must be saved as a .php file. (If your page is currently saved as an .htm or .html file, please see the instructions below on how to get it working on your page.)
Edit the config variables at the top of the script and enter the appropriate information.
You should now be up and running! If you have any questions or problems, please post a comment below. Feedback is greatly appreciated!
SCP Transfers
SCP (Secure Copy) is an alternative to using FTP and is a more secure protocol. Much like SSH, it uses secure shell encryption to protect your information in transit. If you would like to transfer the data to your web server using SCP then follow the instructions listed below. If you’re not sure if support for SCP (SSH) is available to you, you’ll need to check with your web host to see if they support this feature. In order to transfer files via SCP, you’ll need to generate an SSH public/private key pair. These instructions assume that you don’t have any other keys present on your web server.
Open Terminal on your local computer and start a new shell session from the File menu.
Type “ssh-keygen -d”.
After entering the command, press the enter key three times.
Your public and private keys are now saved to “~/.ssh/id_dsa.pub” and “~/.ssh/id_dsa”.
Copy the key to your webserver by typing “scp ~/.ssh/id_dsa.pub yourdomain.com:.ssh/authorized_keys2”.
Enter the password for your account on the webserver when prompted then press the enter key.
Test the SSH key by typing “ssh yourdomain.com”. It should log you in without a password. If not, check to make sure you typed everything in correctly.
If you successfully connected to your account then you should be all ready to start uploading your iChat status file to your web server.
If Your Pages End in .html
If your pages end in .html there are two different methods that you can follow to get iChatStatusPublisher to work on your site. I recommend the first one even though the second method is easier and doesn’t require you to rename all of your pages. The second method can slow your server down a bit because PHP will have to parse your HTML when it may not need to. These instructions will only work if your website is hosted on a UNIX server.
Rename Your Pages to .php
Rename your pages from .html to .php.
Upload your .php files to your server and delete the .html files which will no longer be used.
Paste the PHP code below where you would like your iChat status to appear in your pages and be sure to change the config variables.
Upload your pages to your web server and you should now be able to view your iChat status.
Now create a new file and name it “.htaccess” without the quotes.
Copy and paste the four lines of code below into the file.
Upload the file to your root web directory (e.g. public_html). This will make it so any links that currently point to your .html pages will be redirected to the new .php pages.
# Redirect any links that point to .html extensions to .php
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.+).html$ $1.php [L]
Use PHP In Your .html Pages
Create a new file and name it “.htaccess” without the quotes.
Copy and paste the line of code below into the file.
Upload the file to your root web directory (e.g. public_html).
Your .html pages will now be parsed as PHP.
Paste the PHP code below where you would like your iChat status to appear in your pages and be sure to change the config variables.
Upload your pages to your web server and you should now be able to view iChat status.
AddType application/x-httpd-php .htm .html
Version History
v1.2 (August 11, 2004)
Added support for transfers via SCP.
v1.1 (August 9, 2004)
Initial release.
Disclaimer
THIS SOFTWARE IS PROVIDED AS-IS, WITHOUT WARRANTY OF ANY KIND. THE AUTHOR DISCLAIMS ANY DAMAGES RESULTING FROM THE USE OR MISUSE OF THIS SOFTWARE.
THIS SOFTWARE IS COPYRIGHT © 2004 JEFF MILLER. YOU MAY USE AND/OR DISTRIBUTE THE SOFTWARE WITHOUT RESTRICTION.
Download
iChatStatusPublisher_1.2.sit
File Size: 4.42 KBs
Downloads: <%=
Net::HTTP.get('www.xhtmled.com', '/scripts/ichatstatuspublisher.php')
%>2,822
There are 13 comments on this post. Post yours →
Tagged with applescript, ichat, scripts, webdev
Comments
Posted by flakaddict on August 11, 2004 EST
Erm…that didn’t work too well. Take a look at the source for the Contact page I have…that will hopefully explain it a little better.
http://www.flakaddict.com/contact.html
I still think your php code rocks, though…the ability to differentiate between Mac and Windows is pretty cool…though I tried IM’ing you a few times from your web site and it brought iChat to the front and didn’t do anything.
Also, if I have the script running in my dock all the time it would get annoying quickly…is there a way to make it run in the background?
And just curious…how did you get the screen shot on the side of your page? I would really like to know how you did that, but also have the ability to turn it off sometimes when I don’t want people to be able to spy…
Posted by Bronski on August 11, 2004 EST
Err, what is FTP? It sends passwords in clear and really shouldn’t be used any more.
Why not simply use AOL’s status-service?
Posted by flakaddict on August 11, 2004 EST
I found that once I logged off, my web site was immediately updated…then I logged back on again and it changed too…we’re talking within a minute here. I guess any bugs AOL used to have are squashed now.
It’s all in the wording…if you say you’re “Online” or “Offline”, that’s being more honest than saying “Available” or “Not Available”. The wording on my site says that I’m “Online”, which is true even if I have an away message set (I do the same thing as you, I’m almost never offline). People can still leave me messages, I’ll get them eventually.
I’d appreciate the tutorial on how you got the screen shot…that is really cool.
Posted by Shaun on August 11, 2004 EST
Just a couple of bug-ettes for you.
AppleScript Code
else if
status is equal to "offline"
then
set iChatStatus to "idle"
Should be:
AppleScript Code
else if
status is equal to "offline"
then
set iChatStatus to "offline"
in iChatAV 2.1 at least
and Xcode was complaining about the use of ‘start’ as a property so I changed it to something else.
Posted by Jordan on August 11, 2004 EST
I was hoping to put the ichat status publisher into my website, but all my pages are html. Is it still possible?
I know very little about php
Posted by Josh on August 12, 2004 EST
How can I point the applescript to my apache webserver instead of FTP and SCP?
Posted by Josh on August 12, 2004 EST
ok, so would i have to change the following in the applescript since i wouldnt be “logging in”, and if so what to:
property login : "login" -- login
property pass : "password" -- password
property transfer : "SCP
and i already use dyndns.org to point my domain to my server, so thas cool. i understand the PHP part of it with no problem now, but im still confused about what I need to do with the applescript.
Thanks so much for helping me out with this though, i really appreciate it a lot. Sorry I’m so much trouble though heh.
Posted by levitra on May 25, 2008 EST
All you would need to do is just delete SCP from the transfer property so it’s empty, but be sure to keep the quotes there. may be not here directly

1
Posted by flakaddict on August 11, 2004 EST
Here’s some code similar to what I used for my web site…not as cool, but it works for me…