Does this site look plain?

This site uses advanced css techniques

You probably don't want this program.
This limited-platform version in perl has been replaced by YGPM, which is written in C++ and runs on all Windows platforms. See that page first. This perl version runs on Unix system though.

This small perl program checks for unread instant messages at DSL Reports, our favorite community web site. Many of us who hang out at DSLR spend more time than we should just waiting for people to send us messages. It's a great way to burn a lot of time.

So instead this program just checks for unread IMs and pops up a message to the screen with "You have DSLR IMs!" inviting a visit. No need for a browser to be open, no need to watch anything. It's been remarkably effective at replacing the frequent and pointless distractions of checking for IMs with the less common and slightly less pointless distraction of actually reading those IMs.

Disclaimer - this tool is a private effort and is not endorsed or authorized (or otherwise commented on) by DSL Reports management. I always speak for me only.

How it works

Justin implemented a new /instantcheck/ mechanism on the server that allows for much easier checking of IMs remotely (announced in this thread). By fetching a page via a URL with our own DSLR user number, get either the small IM icon [Icon: no IMs] or the larger flashing, you've-got-private-messages icon [Icon: IMs pending].

The pages returned are extremely simple, differing only in the image returned. The URL by itself can be used for an on-screen IM indicator, and we suspect that a bit of javascript could be used to create a tiny window without all the standard browser accouterments. But this requires desktop real estate and a bit of a diversion to look at it from time to time: we prefer a synchronous notification of IMs that is entirely out of the picture until IMs arrive.

So we fetch the same URL over and over - every minute or so - and look at the image found inside the page. These images are:

[Icon: no IMs]   imsg.gif - no unread IMs
[Icon: IMs pending] imsg1.gif - unread IMs are available

When we see the you-have-IMs indicator, we cause a user notification (see below), but suppress additional notifications until the IMs have been read. If the user is away from his desk when IMs are available, we don't want to fill the screen with "You have IMs!" messages each minute until the user returns.

User Notifications

User notifications are easily customizable via the notify_user subroutine, and we have provided one sample implementation for NT: sending a "winpopup" message. From the NT command line:

C> NET SEND machine "You have DSLR IMs!"

pops up a small dialog box requiring an [OK] to dismiss. This is the invitation to revisit DSLR and find our message(s) waiting. By default, the NET SEND code in this program routes the winpopup to the current machine, but other options are avialable as well. Typing NET SEND /? will show current options. Note that "name" appears to be a computer name, not a user name.

It's also possible to send a winpopup from UNIX to Windows with Samba. The smbclient program is normally used for file transfer and printing, but it also has a winpopup mode. To send a winpopup to a machine:

$ echo "You have IMs!" | smbclient -M computername

We're quite sure that other mechanisms exist for user notification (particularly in the X11 world) and will add them to the code and to these docs when we learn of them.

Feedback welcome.

Installation on UNIX/Linux

dslrim requires perl 5 or later, along with the entire libwww library set. This is often bundled with some distributions but is apparently not universal. Fetching libwww (with all the various bits and pieces).


but these are commonly found in all modern perl implementations. If not found locally, they can certainly be located at CPAN.

Copy the program to a standard place in the path -- /usr/local/bin/dslrim.p -- make sure that the location of the perl interpreter is correctly reflected on the first line. The default is #!/usr/bin/perl -w. Make sure the program is marked to be executable: chmod a+x /usr/local/bin/dslrim.p.

Installation on Windows NT / 2000 / XP

Note - ActivePerl works great on Windows 98, but the setup is a bit different than for NT. Also, the NET command doesn't seem to be able to send a winpopup message, so we'll look into all of this another day.

Microsoft's resource kit for NT has a really crappy perl implementation, and it's not known if it supports this program. We don't care. We use the free ActivePerl from ActiveState. It's an utterly fantastic implementation of perl for Win32, and we've found that perl programming, even some heavy duty stuff, works flawlessly out of the box. We cannot say enough good things about this outstanding package.

As of Dec 2001, this package could be found in the "Recent Releases" sidebar on the right side of the main web page: Look for "ActivePerl" (not "Visual Perl") and click "download". Windows 2000 and XP users can just click "next", but NT users need to have the Windows Installer 1.1 first: install from the given link, then click Next.

On the next page, choose the MSI version (not "AS"), and it's safe to just open from current location. It downloads the image and runs the installer on it. Accept the license agreement (if you do), then you'll be given a dialog box to select options. Unless you're a developer and know what you're doing, disable everything but the topmost "Perl" by right-clicking each item and clicking "Disable" from the popup. A correct dialog box should look like:

[ActivePerl installer]

On a future dialog box, you'll be asked if you want to add perl to your path and to update file extension assocations. select both. A reboot might be required: do so if asked.

Once perl has been installed, download the two files from the web server (see the DOWNLOAD section below). Remember to rename the perl script from the name that includes the version number ( dslrim-1.00.p ) to one that does not ( dslrim.p ), or at least remember which version you downloaded. I typically put these standalone tools in C:\bin, but you can put them anywhere you like. These examples assume my standard location.

Now let's create a desktop icon to lauch this: it takes a few steps. On the desktop, right-click New, then Shortcut. In the "target", enter the full path of the perl program: C:\bin\dslrim.p (remember to have renamed it from the version-numbered name that was downloaded from the web server. For a Catchy Title, enter something like @TT{DSLR IM checker}. This creates the shortcut, but we have to customize a few more items.

Right click the shortcut on the desktop and select Properties. In the Target field, add perl to the beginning of the line and --user=###### parameter just after the full path of the dslrim.p script. The user number should be taken from the DSLR site, and the final command line should look like

perl c:\bin\dslrim.p --user=340145

with spaces betwen the three parts. Windows might automatically convert perl to the full path of the perl interpreter - this is OK. The Start in directory is not used and may be left at the default, but do select Minimized from the Run dropdown box. Finally, click "Change Icon" and look in c:\bin\dslrim-icon.bmp. Select the single icon found there. When finished, the dialog box should look like:

Click OK to finish customization of the shortcut. Then double-click the icon on your desktop to launch the DSLR IM Checker. It will immediately minimize itself to the task bar, and if you bring up the window it will show the signon box: DSLR IM checker, v1.00 (user# 340145, interval 60)

There is no need to look at this window during normal operations: it's just for debugging. But if the icon does not start minimized, it probably means the program exited for some reason - get help.

Once the program is running, have a friend send you an IM via DSLR. Within a minute you should see the popup:

Here, "WIZ" is the name of the workstation generating the popups - it will be your local system. Click OK to dismiss the popup, then visit DSLR to read your IMs. You will not receive another popup until dslrim has seen that you have read your IMs.

Query Intervals

By default, dslrim checks the DSLR server once a minute looking for unread IMs. This setting corresponds with Justin's auto-refresh value in the web page fetched from the instantcheck HTML - this suggests that this refresh value won't tax the servers too badly.

The interval can be changed with the --interval=## command-line parameter (default is --interval=60), but this probably shouldn't be made smaller without a really good reason. An every-sixty-second check means that (on average) you'll be notified 30 seconds after a new IM arrives. If you need to be notified more rapidly than that, it means you probably need some time away from DSL Reports.

Command Line

A few options are available on the command line:

Specify a DSL Reports user number (usually six digits). This number can be found by putting your mouse pointer over a person's avatar in any post and looking at the URL selected: the digits are the user number.
Specify PXY as a proxy server to use in the form
Specify the query interval in seconds, default = 60.
Show a brief summary of cmdline parameters

Finding your DLSR User ID

Your DSL Reports user ID is a six digit number (unless you're Justin, in which case it's "1"), and there are a handful of places to find it. The easiest place we've found is (while you're logged in), look at the small nav bar at the top of each page:

Click the Posts label, which should bring up a listing of all your own postings. Check the Address bar (where the URL is displayed at the top of the browser), which should be of the form:

This shows the DSL Reports user ID.


The program and icon can be found on this web server:

Stuff still not done

Revision History