I am using oauth for yahoo api to import email contact. And I have been successfully importing all my contact email from yahoo into a page.
My problem now is I am using a javascript to highlight each email in the text area.
This is the sample of the JavaScript which will highlight each email.
echo "$(\"#email-tags\").addTag(\"yahoo@yahoo.com\");";
Now if there is something which is not formatted as email, the text area will be blank won't show any email.
My question now is how to import only something which is formatted as email. Because sometime in email contact, there is some contact from mailer which its format is like this: DAFDGREGSDFHASRFEW2 <= Not email format, which will make my javascript error in the text area and won't show any email.
Here is some last line of yahoo email contact:
// Call Contact API
$retarrs = callcontact_yahoo(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, $guid, $access_token, $access_token_secret, false, true);
//I have to use a delimiter of white space to separate each email here.
$ymail = str_replace(',', ' ', $retarrs);
//This is my javascript tag & the email contact list will show.
echo "$(\"#email-tags\").addTag(\"".$ymail."\");";