Web based address list from PalmPilot

Started by Lutz, April 27, 2004, 11:28:51 AM

Previous topic - Next topic

Lutz

just posted a litle web script to access you addressbook on the web:



http://nuevatec.com/download/addresses-1.2.tgz">http://nuevatec.com/download/addresses-1.2.tgz



If you have a PalmPilot you can export a file: addresses.csv using the Windows PalmDesktop application and exporting all fields from the address application.



An older version of this script has worked for me on different Pilots since several years.



Let me know if it works for you



Lutz

ps: just released addresses-1.2.tgz with the fix for MSII

nigelbrown

#1
Hi Lutz,

Can I have more info on usage. I've not used/setup newlisp cgi before.



I used the link.lsp code to make addresses.cgi.exe which is in my scripts subdirectory of MSII on my winxp-pro. I exported addresses.csv into scripts from palm desktop 4.1 - exporting using the default (export all fields I think).

An example addresses.csv line is

"albany lawns","","","","328-915-99","","","","","","","","","","","","","","","0","Personal



I did

http://localhost/scripts/addresses.cgi.exe?query=brown">http://localhost/scripts/addresses.cgi.exe?query=brown

and got

message in html

Last Name array, list or string expected in function nth : adr  

What query string setting out is used?

Is the export of all fields OK for addresses.csv?

Is doing it as an exe confusing things?



Nigel



PS

http://localhost/scripts/addresses.cgi.exe">http://localhost/scripts/addresses.cgi.exe

 gives html message

string expected : (getenv "QUERY_STRING")

nigelbrown

#2
I got the cgi working by changing line:

(if (!= (getenv "QUERY_STRING") "")



to test for nil return from getenv:

(if (!= (if (getenv "QUERY_STRING") (getenv "QUERY_STRING") "") "")



I then linked the patched addresses.cgi into an exe (still called addresses.cgi)

now

http://localhost/scripts/addresses.cgi">http://localhost/scripts/addresses.cgi

gives all addresses



and clicking on Albany Lawns works giving:



http://localhost/scripts/addresses.cgi?name=albany+lawns">http://localhost/scripts/addresses.cgi? ... bany+lawns">http://localhost/scripts/addresses.cgi?name=albany+lawns





Do you think the patch was needed because of the way getenv returns nil on winxp is different from other systems - I guess MSII may set query_string differently from linux (empty rather than "") but I've not tested it?



Anyway, it works for me now on WinXP-pro.



Thanks Lutz,

Regards

Nigel

Lutz

#3
I don't have access to a system running MSII, but it looks like (getenv "QUERY_STRING") always returns at least "" on Apache webservers on Linux or FreeBSD instead of nil on MSII.



Is it really necessary to bind addresses.cgi with the newlisp.exe executable? Is there no way to run script files associating them to an application like on Linux/BSD? How do people do it with Perl on MSII.



I think there is some kind of setup for MSII to associate certain extensions with certain applications?  What do our Windows ISP users/admins say?



Anyway I am glad you found the problem. Binding the the cgi file into newlisp.exe seems to be a good trick and I will change the 'getenv' line to take care of MSII in the future.



Lutz



ps: just released addresses-1.2.tgz with the fix for MSII

nigelbrown

#4
Re Is it really necessary to bind addresses.cgi with the newlisp.exe executable? Is there no way to run script files associating them to an application like on Linux/BSD? How do people do it with Perl on MSII.



I think there is some kind of setup for MSII to associate certain extensions with certain applications? What do our Windows ISP users/admins say?



Ithink the issue may? be around permissions, at  http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q160422">http://support.microsoft.com/default.as ... US;Q160422">http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q160422& "How IIS Launches a CGI Application" it says

... when the Anonymous account does not have rights to the CGI. When you try to launch the CGI application, IIS uses the Anonymous user. Because the account does not have rights to the file, the process fails to run and an error message is returned via STDOUT.



Rather then adjust permissions or associate .lsp with newlisp (as I try out various lisps from time to time and they may rudely associate .lsp with themselves without asking) putting a linked executable into the script directory is simple. I don't know if within MSII you can specify associations.



I use the MSII to run Namazu full text search engine on some of my local files so I looked at how they did it and they have namazu.cgi.exe in their script directory so I just did as they did ie used an exe.

Having a linked exe also sidesteps compatibility changes between versions (although this is rarely an issue with newlisp) but you need to be aware of bug fixes.



Nigel