Nokia Smart Messaging vCard perl script


This perl script translates name, phone number and e-mail information into a format which is understood by many nokia phones (examples include the 5160, 5165, 6160, 6165 and 8260 there's probably others as well). The output of this script can then be e-mailed to your phone if your cellular provider offers that service. For the impatient, I'll provide some links right up front and then go on to explain what they're all about.

Download the perl source code for the program.

Or use it online

How to Use This Program

This perl script can be used in three different ways, interactively from the command line, in batch mode from the command line or as a cgi program with a web server.

If you want to run this program from the command line, you will need a perl interpreter and a mailer installed on your computer. Linux machines generally have these things installed without any particular worry. Windows machines will probably need to have these things installed. You can get perl for windows from Activestate and you can get a mailer from blat.net.

Once you've done that, you can run this program from the command line. Use the command perl vcal.pl -? to find out what all your options are. You can also specify some of the parameters in the script itself to save yourself a little bit of typing. To do this, open vcard.pl in a text editor (notepad in Windows or vi or pico in Linux) and change the lines that start with $SENDMIL $MAILHOST $FROM and $TO as appropriate for your system.

If you want to use the program in batch mode to send a large number of calendar items to your phone at once you will need to create a text file with a list of calendar items. The file should look something like this:

PHONE CALL, 20020219, 151500, 8005551212, 20020219, 150000
SPECIAL OCCASION, 19460706, 235959, George W. Bush, 20020706, 120000
MEETING, 20020301, 140000, Evil Conspiracy, 20020301, 134500
MISCEllANEOUS, 20020224, 235959, Give Pills to Dog, 20020224, 220000

This example will add the following events to the calendar on my phone. On the first line I have a reminder that I should call (800)555-1212 at 3:15 PM on the 19th of Febuary 2002, I will be reminded of this at 3:00 PM the same day. The second line sets up a birthday reminder so that I remember when it's the president's birthday, I will be reminded of this at noon. The third line adds a meeting reminder for the meeting about the Evil Conspiracy I have on March 1st, 2002. This meeting starts at 2:00 PM and I will be remended at 1:45. The last line contains a reminder. I need to give heartworm pills to the dog on the 24th of this month and need to be reminded of that at 10 PM.

The final way to use this program is as a cgi script for a web server. To do this, you will need access to a machine that is running webserversoftware that you have access to the cgi-bin directory on. All you need to do then is copy vcard.pl into the cgi-bin directory and call it from your web browser. Alternately, you can just use it from this server by clicking here.

Notes on the Nokia Smart Message Calendar Format

Header format is similar to the other smart message formats:

//SCKL23F5wwwwxxyyzz

where //SCKL indicates a message in smart message format, 23F5indicates that the message is a vcal message, xx is a message ID number which is more or less unique to each message, and yyzz indicates which part of the message in the format message zz of yy. Following this header information is a space (0x20) and then a hexidecimal representation of the ASCII data.

My Nokia 8260 supports four different kinds of calendar entries, birthdays, phone calls, meetings and reminder. Each has a slightly different layout in the vcard format. First the Birthday reminder, someone named GGG was born on the 9th of October in 1999 and I wish to be reminded of this at 8:00 in the evening. The vcalendar gets shaped up about like this:

BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
CATEGORIES:SPECIAL OCCASION
SUMMARY:GGG
DTSTART:19991009T235959
DALARM:20011009T200000
END:VEVENT
END:VCALENDAR

Next up, we have a meeting called DDD which is happening at 8:00pm on the 9th of October 2001. I have set the phone to remind me 10 minutes beforehand. The Vcalendar text works out like so:

BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
CATEGORIES:MEETING
SUMMARY:DDD
DTSTART:20011009T200000
DALARM:20011009T195000
END:VEVENT
END:VCALENDAR

I want to be reminded of AAA at 8:00pm on the 9th of October 2001. The vcalendar text from my phone reads like so:

BEGIN:VCALENDAR
VERSION:1.0
CATEGORIES:MISCELLANEOUS
SUMMARY:AAA
DTSTART:20011009T235959
DALARM:20011009T2000000
END:VCALENDAR

Now, Let's try an appointment to make a phone call to 1234567890 at 8:00pm on the 9th of October 2001, I'd like to be reminded of this 10 minutes before hand. The vcalendar Text should be:

BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
CATEGORIES:PHONE CALL
SUMMARY:1234567890
DTSTART:20011009T200000
END:VEVENT
END:VCALENDAR