Skype for Phone Numbers?

View my reply to this message in the Web forum. (If you’re reading this in mail, click on the link at the bottom of the message.)

Then click on my name to view my profile. You should see a skype link, and if you view source ok the page, you’ll see how it’s constructred.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What do you want to do with the usernames? I don’t understand that question.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sometime around 6/9/08 (at 19:10 -0400) waltd said:

What do you want to do with the usernames?

I presume he means making a Skype username a clickable Skype link. So
what’s the code? Ahh, nevermind, I’ll go fire up a browser… :slight_smile:

k


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sometime around 6/9/08 (at 19:00 -0400) waltd said:

You should see a skype link

Yep - is the code really just this?

 skype:walterdavis

It doesn’t seem to work; Safari hasn’t a scooby what to do with it.
Oh hang on, I don’t have Skype on this Mac. That must be the problem.

k


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 6 Sep 2008, 11:31 pm, thatkeith wrote:

Sometime around 6/9/08 (at 19:00 -0400) waltd said:

You should see a skype link

Yep - is the code really just this?

 skype:walterdavis

It doesn’t seem to work; Safari hasn’t a scooby what to do with it.
Oh hang on, I don’t have Skype on this Mac. That must be the problem.

k

Sorry, I forgot I do some serious messing with these microformats in JavaScript. What the browser sees when you click on it is this:

href="skype:walterdavis?call"

And the computer where you’re doing the clicking has to understand what that means, which usually means you have to have Skype installed.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Here’s the whole function to deal with the microformats:

if($('bio') && $('bio').type != 'textarea'){
	text = $('bio').innerHTML;
	text = text.gsub(/baim:([-a-zA-Z0-9_.,@]+?)(<|s)/,function(match){return 'AIM: <span class="fake_link aim" id="' + escape(match[1]) + '">' + match[1] + '</span>' + match[2]});
	text = text.gsub(/bymsgr:([-a-zA-Z0-9_.,@]+?)(<|s)/,function(match){return 'Yahoo Messenger: <span class="fake_link ymsgr" id="' + escape(match[1]) + '">' + match[1] + '</span>' + match[2]});
	text = text.gsub(/bmsnim:([-a-zA-Z0-9_.,@]+?)(<|s)/,function(match){return 'MSN: <span class="fake_link msnim" id="' + escape(match[1]) + '">' + match[1] + '</span>' + match[2]});
	text = text.gsub(/bxmpp:([-a-zA-Z0-9_.,@]+?)(<|s)/,function(match){return 'Jabber: <span class="fake_link xmpp" id="' + escape(match[1]) + '">' + match[1] + '</span>' + match[2]});
	text = text.gsub(/bskype:([-a-zA-Z0-9_.,@]+?)(<|s)/,function(match){return 'Skype: <span class="fake_link skype" id="' + escape(match[1]) + '">' + match[1] + '</span>' + match[2]});
	$('bio').update(text);
	$('bio').observe('click',function(evt){
		elm = Event.element(evt);
		if(elm.hasClassName('aim')){
			Event.stop(evt);
			return window.location.href = 'aim:goim?screenname=' + unescape(elm.id);
		}
		if(elm.hasClassName('ymsgr')){
			Event.stop(evt);
			return window.location.href = 'ymsgr:sendIM?' + unescape(elm.id);
		}
		if(elm.hasClassName('msnim')){
			Event.stop(evt);
			return window.location.href = 'msnim:chat?contact=' + unescape(elm.id);
		}
		if(elm.hasClassName('xmpp')){
			Event.stop(evt);
			return window.location.href = 'xmpp:' + unescape(elm.id);
		}
		if(elm.hasClassName('skype')){
			Event.stop(evt);
			return window.location.href = 'skype:' + unescape(elm.id) + '?call';
		}
	});
}

What all this does is allow you to put aim:waltdphila or skype:walterdavis in as text, and have a nice formatted link replace it. All of this magick relies on Prototype, naturally.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Wow. Lot more complicated than I thought.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Well, this was a way to allow users to use one consistent
microformat, and then deal with the differences between the various
chat/voip formats transparently. If all you want to do is hard-code a
link to skype, then you can simply use:

 skype:userNameHere?call

If you enter that in the hyperlink dialog, without selecting any
protocol, then you will have your link.

If you look through the JavaScript, you’ll see that there are
templates to deal with MSN, Jabber, Yahoo Messenger, and AIM as well.
If you don’t need those, then the code can be much simpler. And if
you are hard-coding the link (thus don’t need all this microformat
goodness anyway) you can skip right to the end, to what the link
looks like when it exits the sausage machine.

AIM:

 aim:goim?screenname=userNameHere

Yahoo!

 ymsgr:sendIM?userNameHere

MSN:

 msnim:chat?contact=userNameHere

Jabber:

 xmpp:userNameHere

Now all of this is an error message waiting to happen in the user’s
browser if they don’t (as Keith noted) have a “scooby” about what to
do with a skype: url. Generally, you can count on a user being
confused in that case. Your answer, “well you should have Skype
installed if you plan on contacting someone via Skype…” will in
fact fall on deaf ears – remember, this is the end of the computer
experience scale that calls the DVD tray the “cup holder”.

Walter

On Sep 8, 2008, at 2:05 AM, Rocky Slaughter wrote:

Wow. Lot more complicated than I thought.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options