Skip to content

Instantly share code, notes, and snippets.

@mattes
Last active April 20, 2017 17:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattes/5253271 to your computer and use it in GitHub Desktop.
Save mattes/5253271 to your computer and use it in GitHub Desktop.
print skype status
<!DOCTYPE html>
<head>
<title>Skype Status</title>
</head>
<body>
<h1>Return Skype Status</h1>
<p>return skype status (requires the skype privacy setting set to true)<br>
using Open Data tables with YQL (<a href="http://www.datatables.org/">www.datatables.org</a>)</p>
<p>Offline (1), Online (2), Away (3), Do not disturb (3)</p>
<p><span id="user"></span> <span id="status">Loading ...</span></p>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
var getSkypeStatus = function(user, callback) {
if(!user) throw new Error('missing user');
var query = 'select * from skype.user.status where user="' + user + '";';
$.getJSON('http://query.yahooapis.com/v1/public/yql?q=' + encodeURI(query + '&format=json&env=store://datatables.org/alltableswithkeys&callback=?'),
function(data){
if(data.query.count > 0) {
if(callback) return callback.call(null, data.query.results.result);
} else {
if(callback) return callback.call(null, false);
}
});
}
var user = 'mkadenbach';
$('#user').html(user + 's skype status:');
getSkypeStatus(user, function(status){
if(status) {
$('#status').html(status.message.en + ' (' + status.status + ')');
} else {
$('#status').html('unable to load status');
}
});
});
</script>
</body>
</html>
@luizaceotto
Copy link

Dear developer, your code does not work. Please take a look again. It's not cool for you to have wrong codes on github, people all over the world are eyeing our codes, and many of them are looking for people for possible hiring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment