Requirements:
- Linux
- IR port for your computer
- IR drivers/services installed (google for this)
- Nokia 3360 (or something comparable model phone; try yours and let me know if it works)
- ircp (google for this as well)
- Term::ReadKey
Here's how it works: click "Contacts" in your Evolution "Shortcuts" menu; in your menubar go to "Edit"->"Select All"; then "File"->"Save as VCard" to a working directory that you don't mind alot of .vcf files piling up in (one per contact).
Set your phone to receive in it's "Infrared" menu. Now, grab this script, make it executable, and run it like so: ./ev2noki.pl contactsFromEvolution.vcf, making sure that your phone's IR port and your computer's IR port are aligned (pointing at each other). I use a mirror since my IR port is on the back of my laptop.
The script immediately begins transmitting each contact individual, causing your phone to ring and prompt you to accept the transmission. Then you need to hit any key on your computer to initiate the next transmission. Yes, I know this sucks and takes a while for a large number of contacts but I've been unable to locate documentation on how to transmit them all at once. When I do, I'll update the script. It'll also be available at http://dpatrick.perlmonk.org/code.
D.
#!/usr/bin/perl
use strict;
my $i = 1;
my $list_vcf_file = @ARGV[0];
open(LISTVCF, $list_vcf_file);
while(<LISTVCF>) {
if (/(^BEGIN:VCARD\r\n$)/) {
open(ENTRY, ">./$i.vcf");
print ENTRY $1;
}
elsif (/(^\r\n$)/) {
print ENTRY $1;
close ENTRY;
print "Initiating vCard transmission #$i...\n";
print `ircp $i.vcf 2>&1`;
print "Hit any key for next transmission....\n";
use Term::ReadKey;
ReadMode('cbreak');
my $key;
while (not defined ($key = ReadKey(0))) {
1;
}
ReadMode('normal');
$i++;
}
elsif (/(^END:VCARD\r\n$)/) {
print ENTRY $1;
}
else {
s/FN/X-EV2NOKI-ORIG-FN/;
s/X-EVOLUTION-FILE-AS/FN/;
print ENTRY $_;
}
}
close LISTVCF;
print "\nDone.";
|