Today’s json interface in history, share it with everyone, the data comes from wiki
$.getJSON('http://history.sturgeon.mopaas.com/jsonp?callback=?',function(data){
parserTodayObj(data);
});
function parserTodayObj(todayObj){
for(var key in todayObj){
if(/^.*birth.*$/.test(key)){
doBirthday(todayObj[key]);
}
if(/^.*Holiday.*$/.test(key)){
doHoliday(todayObj[key]);
}
if(/^.*Customs.* $/.test(key)){
doHoliday(todayObj[key]);
}
if(/^.*Death.*$/.test(key)){
doDeath( todayObj[key]);
}
if(/^.*事记.*$/.test(key)){
doMemorabilia(todayObj[key]);
}
}
}
parserTodayObj(todayObj);
function doBirthday(birthdays){
if(birthdays.length != 0){
$(document.body).append("
" birthdayitem "
");function doHoliday(holidays){
if(holidays.length != 0){
$(document.body).append("
" item "
");function doDeath(deaths){
if(deaths.length != 0){
$(document.body).append("
" item "
");function doMemorabilia(memorabilias){
if(memorabilias.length != 0){
$(document.body).append("
" item "
");$.getJSON('http://history.sturgeon.mopaas.com/jsonp?callback=?',function(data){
parserTodayObj(data);
});
function parserTodayObj(todayObj){
for(var key in todayObj){
if(/^.*birth.*$/.test(key)){
doBirthday(todayObj[key]);
}
if(/^.*Holiday.*$/.test(key)){
doHoliday(todayObj[key]);
}
if(/^.*Customs.* $/.test(key)){
doHoliday(todayObj[key]);
}
if(/^.*Death.*$/.test(key)){
doDeath( todayObj[key]);
}
if(/^.*事记.*$/.test(key)){
doMemorabilia(todayObj[key]);
}
}
}
parserTodayObj(todayObj);
function doBirthday(birthdays){
if(birthdays.length != 0){
$(document.body).append("
" birthdayitem "
");function doHoliday(holidays){
if(holidays.length != 0){
$(document.body).append("
" item "
");function doDeath(deaths){
if(deaths.length != 0){
$(document.body).append("
" item "
");function doMemorabilia(memorabilias){
if(memorabilias.length != 0){
$(document.body).append("
" item "
");