PDA

View Full Version : modify what plaxo returns?


m3avrck
December 29th, 2006, 02:58 PM
Right now Plaxo returns emails in the format:

"john doe" <john@doe.com>

While this is standard format, it isn't useful in all cases. For instance, the best format for me would be just a comma separated list of email addresses only. And I'm not the only one, Google that for my people looking to do the same :-)

What if Plaxo's showPlaxoABChooser() had a 3rd parameter to distinguish the *format* of emails returned? Standard, just emails, etc... that would make it much more useful in my opinion.

Till then, here is some JS parsing code I wrote (would be cleaner if I could use jQuery, *wink*) that does just this:


function onABCommComplete() {
// grab all of the emails from Plaxo
// ADJUST TO POINT TO YOUR TEXTAREA
var emails = document.forms[1].elements[0].value;
// strip out all of the names associated with emails
emails = emails.match(/<([^>]+)>/g).join(', ');
// strip out the opening and closing brackets
emails = emails.replace(/[<>]/g,'');

// ADJUST TO POINT TO YOUR TEXTAREA
document.forms[1].elements[0].value = emails;
}

kas
January 4th, 2007, 05:48 PM
>>What if Plaxo's showPlaxoABChooser() had a 3rd parameter to distinguish the *format* of emails returned? Standard, just emails, etc... that would make it much more useful in my opinion.

Interesting idea, m3avrck. I'll pass that along to engineering.

Thanks for sharing your JS parsing code.

Kathy

Mark Lewis
August 23rd, 2007, 07:12 AM
Hi,

could you tell me how exactly you get it to point to the text area?

I mean how is it actually written? for example:

replace // ADJUST TO POINT TO YOUR TEXTAREA

with // recipients_list

or // 'recipients list' ... etc

uncas
September 13th, 2007, 02:27 PM
Hi m3avrck,

I have the same exact problem...I think the script is great...

But, unfortunately it is throwing error on this line when I try to execute...

emails = emails.match(/<([^>]+)>/g).join(', ');

Do you have any ideas...

Thanks,
Uncas

fuzen
September 18th, 2007, 03:53 AM
if you only need the email addresses in plain format, the onABCommComplete() function accepts data parameter. Its an array of the contacts returned.

sample:

function onABCommComplete(data) {
// assuming firebug is installed
console.dir(data);
// format of data is
// [ ['Fred Foo','fooman@email.com'] , ['Barney Bar','barman@email.com'] ]
}

fuzen
September 18th, 2007, 03:58 AM
if you only need the email addresses in plain format, the onABCommComplete() function accepts data parameter. Its an array of the contacts returned.

sample:

function onABCommComplete(data) {
// assuming firebug is installed
console.dir(data);
// format of data is
// [ ['Fred Foo','fooman@email.com'] , ['Barney Bar','barman@email.com'] ]
}

uncas
September 24th, 2007, 08:29 PM
I am afraid I don't have firefox installed..Is there another way to do this with PHP or Javascript...

uncas
September 24th, 2007, 10:10 PM
I meant "firebug"...not firefox :)

plusbryan
October 3rd, 2007, 05:39 PM
Ironically, the Firefox prereq also applies to Firebug. ;-)