iPhone presence indicator for your website

You can add presence indication to your website, i.e. it tells people whether your phone is on or not. This works for any phone that can check mail on a automatically.

Procedure:
1. Set up a mail server (apt-get install solid-pop3d)
2. Create a user on the system and set up your phone to access that mailbox
3. Have your website poll a file that the mail server will touch (/var/lib/solid-pop3d/bulletins/)

Example:
http://phor.net/personal

----

Notes:
- Makes sure your filesystem supports atime for /var
- update-rc.d solid-pop3d defaults
- sample code:

  $stat = stat('/var/lib/solid-pop3d/bulletins/');
if (time() - $stat[8] > 20*60)
$news[] = array('title'=>'Phone', 'cite'=>'http://apple.com/iphone', 'desc'=>'My iPhone is off (it was last on '.reltime($stat[8]).')', 'date'=>time(), 'icon'=>'phoneoff');
else
$news[] = array('title'=>'Phone', 'cite'=>'http://apple.com/iphone', 'desc'=>'My iPhone is currently on', 'date'=>time(), 'icon'=>'phoneon');

Comments

Popular posts from this blog

Nontechnical: What is ERC-721?

I Was Kidnapped in Manila and Lived to Tell About it

Grandmom bakes virus bread