Created
February 19, 2012 12:06
-
-
Save en45masao/1863463 to your computer and use it in GitHub Desktop.
The Longest Day in iKnow!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var uid=''||window.prompt('iKnow! ID:','en45');$.get('http://iknow.jp/api/users/'+uid+'/study_results.json?since=2009-11-04',function(data){var max=0;var date='';$.each(data.daily,function(i,item){if(max<item.daily.items.seconds){max=item.daily.items.seconds;date=item.date;}});var s=max%(60);var m=Math.floor(max/60)%(60);var h=Math.floor(max/3600);alert('The Longest Day: '+h+'h '+m+'m '+s+'s '+date);});})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var uid='' || window.prompt('iKnow! ID:', 'en45'); | |
$.get('http://iknow.jp/api/users/' + uid + '/study_results.json?since=2009-11-04', function(data) { | |
var max = 0; | |
var date = ''; | |
$.each(data.daily, function(i, item) { | |
if (max < item.daily.items.seconds) { | |
max = item.daily.items.seconds; | |
date = item.date; | |
} | |
}); | |
var s = max % 60; | |
var m = Math.floor(max / 60) % 60; | |
var h = Math.floor(max / 3600); | |
alert('The Longest Day: ' + h + 'h ' + m + 'm ' + s + 's ' + date); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment