Last active
May 2, 2019 16:42
-
-
Save rorqvist/8e3c535851c6456c620d3abe1df08562 to your computer and use it in GitHub Desktop.
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
statistics |
Author
rorqvist
commented
Nov 27, 2018
<script src="wpcom.js"> </script>
<script>
// create a client WPCOM instance
var wpcom = WPCOM();
// retrieve a listing of the most recent
// 5 posts on "en.blog.wordpress.com"
wpcom
.site('en.blog.wordpress.com')
.postsList({ number: 5 }, function(err, data) {
if (err) throw err;
console.log('the newest 5 blog post titles are:\n');
data.posts.forEach(function(post, i) {
console.log(' %d: "%s"', i+1, post.title);
});
});
</script>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment