[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coldsync-hackers] coldsync frontends?
Andrew Arensburger wrote:
> > I do not have any specific format in mind -- I'm just looking for a
> > more convenient way to enter data to standard Palm applications than
> > Graffiti.
>
> A few days ago, I wrote a quick and dirty script to add a memo to
> a MemoDB.pdb file. I've been meaning to clean it up and put it on the net.
> If you don't hear from me, bug me about it.
And I still use my Memo Tidbits conduit regularly, always sure to have
the latest local weather and my online bank statment one button press
away:
http://www.astro.cornell.edu/~jdsmith/memo-tidbits.html
That's a "fetch" conduit. As for "sync" conduits, there's always my
Desktop-Palm Time syncer (by the way, did a "none" type ever get
implemented for syncs operations like this which don't tie to a specific
database?):
################################################################
#!/usr/bin/perl -w
# Conduit SyncTime: (C) 2001 J.D. Smith
use Palm::Datebook;
use ColdSync;
use ColdSync::SPC;
StartConduit("sync");
($sec,$min,$hour,$day,$mon,$year)=localtime;
$mon++;
$year+=1900;
my $ret=dlp_SetSysDateTime($year,$mon,$day,$hour,$min,$sec);
EndConduit();
################################################################
I have a fetch+dump conduit which works with the ShowTimes database
format (it's a program for movie times and reviews).
And another in the category of one-off database munging script using
p5-Palm is appended. It simply adds Easter to the Datebook (some CPAN
modules required). Beware the special Datebook4 Note field addition at
the end, and remove if necessary.
I also whipped up a script to add flight information from multi-leg
itineraries I receive by email. No more mistaking "departs 9:25" with
"departs 9:52".
The point of all this is that there are several *very* convenient tools
Andrew has made available for working with your databases if you know a
bit of Perl, both for special-purpose, one-time operations for which the
term "conduit" is a little much, and for full-purpose, data syncing
conduits which run at every HotSync. The excellent "conduits" texinfo
tutorial distributed with the source is very instructive, and suggested
reading.
Good luck,
JD
################################################################
#!/usr/bin/perl -w
# AddEaster: (C) 2001 J.D. Smith
use Palm::PDB;
use Palm::Datebook;
use Date::Easter;
$pdb=new Palm::PDB;
if (@ARGV) {
$file=$ARGV[0]."/DatebookDB.pdb";
} else {
$file="$ENV{HOME}/.palm/backup/DatebookDB.pdb";
}
$pdb->Load($file) or die "Can't open file $file: $!";
($tday,$tmonth,$tyear)=(localtime)[3..5];
$tmonth+=1;
$tyear+=1900;
for $year ($tyear..$tyear+20) {
($month,$day)=easter($year);
# Only add this years if it has yet to happen
if ($year==$tyear) {
next unless ($month>$tmonth || ($month==$tmonth && $day>=$tday))
}
# See if there's already a database available
foreach $rec (@{$pdb->{records}}) {
if($rec->{day}==$day && $rec->{month}==$month &&
$rec->{year}==$year) {
$pdb->delete_Record($rec, 1) if $rec->{description}=~/easter/i;
}
}
print "Adding $year-$month-$day\n";
$record=$pdb->append_Record;
delete $record->{alarm}; # Why is alarm set by default???
$record->{day}=$day;
$record->{month}=$month;
$record->{year}=$year;
$record->{description}="Easter";
$record->{note}='##@@@m@@@@@@@@@@@@@\n'
}
rename $file, $file . ".bak" or die "Can't rename database: $file";
$pdb->Write($file);
################################################################
This message was sent through the coldsync-hackers mailing list. To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body. For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.