Online status indicator
Here is the status scripts I wrote that power this: http://digital39.com/status.php. I wrote them so that people who do not use any chat services or do not have me added can check my status. This can be very handy for more internal things where you would not want everyone on your buddy list seeing what you are doing. I plan to write a GUI or web interface to add multiple users and their URLs for use with teams or among friends. It requires a web server running PHP and Python on your computer. I recommend you add a little security to the “set” so that not just anyone can change your status. It is also very simple, so if the server is down it will throw an error. I created it for personal use more than anything but if you can use it be my guest, just don’t try to take credit for it. I also recommend you use a program that has tabs such as Console, which you can see my screen shot here
How to use it:
Run “status.py” from the command line, it will show your current status and prompt you for an update. The script will continue to run until you type ‘exit’. You can also double check your online status is what you last set it as by typing ’show’. You must also make sure the directory where status.php can write to status.txt.
Enjoy
-
from urllib import urlopen, urlencode
-
from base64 import b64decode, b64encode
-
-
f = urlopen(‘http://digital39.com/status.php?get’)
-
statux = b64decode(f.read())
-
tmp = statux
-
print ‘Current Status: ‘+statux
-
while (statux != ‘exit’):
-
statux = raw_input("Status: ")
-
if (statux == ’show’):
-
print ‘Current Status: ‘+tmp
-
elif (statux != ‘exit’):
-
f = urlopen(‘http://digital39.com/status.php?set=’+b64encode(statux))
-
tmp = b64decode(f.read())
and now the PHP
-
$fname = "status.txt";
-
-
$fcontent = $_GET[’set’];
-
} else {
-
$fcontent = "<html><head><title>Status</title></head><body>".base64_decode($fcontent)."</body></html>";
-
}
-
echo $fcontent;
-
}
and there it is.







