Hack 88. Show Your Online Status in a Web Page
Add your Skype online status to any web page by using this hack. Works with: Windows version of Skype. With this neat little add-on, you can make your Skype online status available in real time from any web page. First, you must download and install the add-on by visiting its support page at http://www.skyperunners.com/board/viewtopic.php?t=30. What you're downloading is a Windows install package that takes care of all the installation details; just follow the instructions. Once it's installed, you're ready to start building web pages that show your Skype online status.
After starting the online status indicator, you should test it by visiting http://www.skypestatus.com/Skypename.gif. This URL will be created automatically for whatever your Skypename might be. You should see something like that shown in Figure 11-9. The online status indicator returns a button image based on your online status (see Figure 11-10), but not all types of online status are properly indicated (see Table 11-4). Figure 11-9. Test your online status indicatorFigure 11-10. Online status indicator buttons
Here's how the online status indicator works. The online status add-on communicates with a remote web server to notify it of changes in your online status. Then, each time that same web server receives a request via your custom URL, it checks to see what your last online status was reported as being and delivers the appropriate button image as the response to the request. This means that wherever you use an image in a web page, you can instead use your (real-time-updated) online status button. However, you need not stop at merely displaying your online status, as you can combine your online status with the skype: and callto:// protocols (see "Make Calls from Your Web Browser" [Hack #43]) to provide any Skype user who looks at your web page the one-click convenience of calling you simply by clicking on your online status button. The following XHTML file, online_ status.htm, shows you how to do this (you will need to replace skypename with your own Skype username): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- File: online_status.htm --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Skype Online Status</title> </head> <body> <p><a href="callto://skypename"> <img alt="Online status for skypename" src="/books/3/92/1/html/2/http://www.skypestatus.com/skypename.gif" /> </a></p> </body> </html> 11.4.1. Hacking the HackThere's no reason to stop at web pages! Any live document in which you can embed an image as an http:// hyperlink that is updated is a candidate for your online status indicator. For example, this Microsoft Outlook signature file, skype_hacks.htm, includes an online status indicator button: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- File: skype_hacks.htm --> <HTML> <HEAD> <TITLE>Skype Hacks Signature</TITLE> </HEAD> <BODY> <P>Skype Hacks <A href="callto://skypehacksbook"> <IMG alt="Online status for skypehacksbook" src="/books/3/92/1/html/2/http://www.skypestatus.com/skypehacksbook.gif" /> </A> </P> </BODY> </HTML> As long as the recipient of your email has a mail reader that can display HTML, your signature will display your online status (see Figure 11-11). However, the result might not be a real-time and up-to-date display of that status. Ever-popular web-based email will typically refresh an email message each time it is opened, which is something that regular email applications may not do. Regardless of whether your online status button accurately portrays your online status, if the recipient clicks on the button and is a Skype user (with callto:// directed to Skype), Skype will open and start a call to you. Figure 11-11. Online status button as part of an email signature |