Reading contacts from command line?
Hi,
I'm trying to do a simple script that reads and lists contacts from osso-abook. So far I have found that the contacts are in /home/user/.osso-abook\db - file wich is a Berkley database file. But I haven't found any tool to read that, any suggestions how to do that? Is it possible to read contacts via dbus? If yes, then how? =) I'm doing some nice little web interface to control N900, so far I have made a simple web interface (lighttpd + PHP) and I can read my messages and check calls via that web interface. I can also do everything that Phone_control (thanks to MohammadAG, made my scripts much simpler :D) does and some tricks more via that web interface. Oh, and of course that interface is heavily password protected :) // Jarkko |
Re: Reading contacts from command line?
rtcom probably is just too much for a script:
http://wiki.maemo.org/Documentation/...itecture/RTCOM have you tried reading the db with sqlite? |
Re: Reading contacts from command line?
Quote:
I found that there is a program called db4.7_dump that reads that db, but haven't found it for arm thought... // Jarkko |
Re: Reading contacts from command line?
|
Re: Reading contacts from command line?
Quote:
Thanks, but I can't find a working version anywhere... Here are some screenshots what have done so far with lighttpd + php: http://www.jmv.fi/N900/ |
Re: Reading contacts from command line?
in backup zip there are all the contacts within one backup.vcf -file.
don't know though if the backup thing can be run within command line. but that would be one way to do it. |
Re: Reading contacts from command line?
Quote:
Looks like the only way is to write a small C / C++ application using libdb or libebook to get at the contacts. |
Re: Reading contacts from command line?
Quote:
Ok, have to do that then. Thanks. |
Re: Reading contacts from command line?
Since I back up with rsync to my desktop and laptop, I have a copy of the DB on a machine that has db_dump. I found that "db_dump -p" gives a series of vcards encoded one per line. It wouldn't be hard to parse those further using a tool like awk or python.
Now that I think about it, Python has a Berkeley DB access library (bsddb), although I don't know if it's available for Maemo. Jarkko, what kind of tool are you imagining? I.e., are you thinking "lookup_contact --home-phone Joe" would print out Joe's home phone number? (I'm thinking that if somebody writes a tool, it would be good to try to make it flexible so other people can use it in unanticipated ways.) |
Re: Reading contacts from command line?
Quote:
As far as I know, bsddb is not available for maemo. At least it is not included as default and quick search didn't give any results either. Just simple export, like "dump_contacs -name -phonenumber -email -db addressbook.db" that exports contacts, for example "John Doe 123456789 john.doe@something.com". That way output could be parsed and maybe some other ppl would find some other use to that tool also. If I have time, I'll start to write that kind of app...but I'll guess it will take some time. Busy at work nowdays... Regards, Jarkko |
All times are GMT. The time now is 00:01. |
vBulletin® Version 3.8.8