UNPKG

2.51 kBHTMLView Raw
1<!DOCTYPE html>
2<html>
3 <head>
4 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6 <meta name="viewport" content="width=device-width">
7
8 <link
9 rel="shortcut icon"
10 type="image/vnd.microsoft.icon"
11 href="//s1.wp.com/i/favicon-stacked.ico?m=1311976025g"
12 sizes="16x16 32x32 48x48" />
13
14 <link
15 rel="shortcut icon"
16 type="image/x-icon"
17 href="//s2.wp.com/i/favicon.ico?m=1311976025g"
18 sizes="16x16" />
19
20 <link
21 rel="icon"
22 type="image/x-icon"
23 href="//s2.wp.com/i/favicon.ico?m=1311976025g" />
24
25 <link rel="stylesheet" href="style.css">
26
27 <link
28 href="http://fonts.googleapis.com/css?family=Merriweather|Open+Sans:400,300,600"
29 rel="stylesheet"
30 type="text/css" />
31
32 <script type="text/javascript" src="webapp-bundle.js"></script>
33
34 <title>WPCOM.js - Official JavaScript library for the WordPress.com REST API</title>
35 </head>
36
37 <body>
38 <section id="wrapper">
39 <div class="main-title center">
40 WPCOM.JS
41 <div id="wpcom-version"></div>
42 </div>
43
44 <div class="project-title center">
45 JavaScript API for WordPress
46 </div>
47
48 <div class="project-desc center">
49 Official JavaScript library for the WordPress.com REST API.<br />
50 Compatible with Node.js and web browsers. </div>
51
52 <div class="center">
53 <a href="https://github.com/Automattic/wpcom.js" class="button git-button">
54 <span>source on github</span>
55 </a>
56 </div>
57
58 <div class="editor-outer center">
59 <div class="editor-inner">
60 <div class="editor-block">
61 <script src="https://gist.github.com/retrofox/ff047b2c231c68ad914e.js"></script>
62 </div>
63 </div>
64 </div>
65 </section>
66
67 <section id="footer">
68 <a href="https://github.com/Automattic" target="_blank" class="center">
69 <div class="foot-desc">
70 Check out more open-source goodness from
71 <div class="foot-img"></div>
72 </div>
73 </a>
74 </section>
75
76 <script>
77 // create a client WPCOM instance
78 var wpcom = WPCOM();
79
80 // retrieve a listing of the most recent
81 // 5 posts on "en.blog.wordpress.com"
82 wpcom
83 .site( 'en.blog.wordpress.com' )
84 .postsList({ number: 5 }, function( err, data ) {
85 if ( err ) throw err;
86
87 console.log(' the newest 5 blog post titles are:\n' );
88 data.posts.forEach(function( post, i ) {
89 console.log( ' %d: "%s"', i+1, post.title );
90 } );
91 } );
92
93 var elVersion = document.getElementById( 'wpcom-version' );
94 if ( elVersion ) {
95 elVersion.innerHTML = pkg.version;
96 }
97 </script>
98 </body>
99</html>