Last active
December 25, 2015 18:49
-
-
Save mersy/7023856 to your computer and use it in GitHub Desktop.
dataapifocategory
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 api = new MT.DataAPI({ | |
baseUrl: "<mt:Var name="website_url">mersy-movabletype/mt-data-api.cgi", | |
clientId: "1234567890" | |
}); | |
var params = { | |
//limit: 10, | |
fields: "id,title,permalink,date,categories" | |
}; | |
getApiEntries (2, params, pageTitle); | |
function setHTML (entryData) { | |
var oldStr = entryData.date; | |
var newStr = oldStr.replace(/(\d{4})-(\d{2})-(\d{2}).*/,"$1年$2月$3日"); | |
return [ | |
'<li>', | |
'<time datetime="' + entryData.date + '">' + newStr + '</time>', | |
'<a href="' + entryData.permalink + '">' + entryData.title + '</a>', | |
'</li>' | |
].join(""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment