Waffle Blog

waf·fle,1 A light crisp battercake baked in a waffle iron.
waf·fle,2 Evasive or vague speech or writing.

Friday, May 26, 2006

Get Google calendar into Rainlendar (Old idea, new twist)

Its rather an old idea, getting your google calendar to appear in your Rainlendar calendar on your desktop. Before the problem has simply been solved with a combination of wget for windows and a small batch file consisting of the commands required to fetch the private URL of the google ical calendar and export it to a file. After this of course the file is included in the list of .ics files for the Ical plugin (within Rainlendar) to import/use.

All this is well and good and works very effectively. But the catch is that since the batch file must be manually run, you have the choice of either navigating to the location of the file and running it (either through the command line or windows explorer) or creating a shortcut to be place on the desktop or quick launch toolbar. Obviously navigation to the file itself is cumbersome and time consuming, So I opted for placing a shortcut on my quick launch toolbar. However, again I become a stickler for optimization, I've never really liked the icon windows associates with batch files, so here is where my own personal twist comes into the whole mess.

At this point I felt then need to create my own program to execute wget. Creating a binary for this solves two (maybe more) problems. One, it ads a level of security for your private calendar address as binaries can be encrypted/scrambled to hide compiled text. Second, it allows you to include an icon for the binary file (not possible with batch files without system mods). Also since you are creating a binary file, you could take this project one step further (depending on your skill with the windows API) and include several registry entries to make this program run as a windows dialog or even as a background process eliminating the new window all together.

In all it the main C source file is composed of about 5 or so lines of actual code:

#include stdio.h
#include "resource.h"

int main(){
system("wget -b -O gencall.ics http://www.google.com/calendar/ical/therestoftheprivatadress");
return(0);
}
The resource.h file of course declares several constants for the inclusion of the resource file. The resource file of course being the file which connects the program with the icon to be associated with the end binary. All this took about 10 minutes in VBC++6, mostly comprising of fixing simple errors and creating the icon. All in all, making for a Farley affective quick hack.

Post containing instructions for creating the batch hack

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home