API continuing to evolve.

This commit is contained in:
Samuel Clay 2011-04-22 10:05:22 -04:00
parent 3f04fbfc82
commit e81a843b09
3 changed files with 276 additions and 237 deletions

View file

@ -5084,9 +5084,6 @@ background: transparent;
margin-top: 36px;
font-size: 24px;
}
.NB-static h3:first-child {
margin-top: 24px;
}
.NB-static h4 {
font-size: 16px;
margin: 24px 0 12px;
@ -5220,12 +5217,17 @@ background: transparent;
.NB-static-api .NB-anchor {
position:relative;
top: -60px;
top: -120px;
display: block;
}
.NB-static-api h3 {
margin-top: 64px;
}
.NB-static-api .NB-api-endpoint {
/* margin-left: 12px;*/
padding-left: 18px;
border-left: 6px solid #EDCE24;
}
.NB-static-api .optional,
.NB-static-api .required {
padding: 2px 4px;

View file

@ -533,14 +533,6 @@ NEWSBLUR.AssetModel.Reader.prototype = {
return null;
},
process_opml_import: function(data, callback) {
if (NEWSBLUR.Globals.is_authenticated) {
this.make_request('/import/process', data, callback);
} else {
if ($.isFunction(callback)) callback();
}
},
save_classifier_story: function(story_id, data, callback) {
if (NEWSBLUR.Globals.is_authenticated) {
this.make_request('/classifier/save/story/', data, callback);

View file

@ -16,6 +16,7 @@
<div class="NB-module">
<h5 class="NB-module-title">API Table of Contents</h5>
<div class="NB-module-content">
<div class="NB-api-endpoint">
<table class="toc">
<tr>
<th colspan="2">Feeds</th>
@ -29,9 +30,13 @@
<td>Favicons for each of a user's feeds.</td>
</tr>
<tr>
<td><a href="#page"><code>/reader/page/:id</code></a></td>
<td><a href="#feed_page"><code>/reader/page/:id</code></a></td>
<td>Original page from a single feed.</td>
</tr>
<tr>
<td><a href="#refresh_feeds"><code>/reader/refresh_feeds</code></a></td>
<td>Get latest unread counts for active feeds.</td>
</tr>
<tr>
<th colspan="2">Stories</th>
</tr>
@ -47,15 +52,27 @@
<td><a href="#river_stories"><code>/reader/river_stories</code></a></td>
<td>Stories from multiple feeds (River of News).</td>
</tr>
<tr>
<th colspan="2">Import/Export</th>
</tr>
<tr>
<td><a href="#opml_upload"><code>/import/opml_upload</code></a></td>
<td>Upload OPML file.</td>
</tr>
<tr>
<td><a href="#opml_export"><code>/import/opml_export</code></a></td>
<td>Download backup of feeds as an OPML file.</td>
</tr>
</table>
</div>
</div>
</div>
<div class="NB-module">
<h5 class="NB-module-title">Feeds</h5>
<div class="NB-module-content">
<div class="NB-api-endpoint">
<h3><tt>GET /reader/feeds</tt></h3>
<a class="NB-anchor" name="feeds"></a>
@ -91,9 +108,9 @@
<h4>Example Response</h4>
<pre><code>
{
{
'feeds': []
}
}
</code></pre>
<h4>Tips</h4>
@ -103,9 +120,10 @@
<li>Turn off <code>include_favicons</code> if you can either cache favicons or can
wait to fetch them.</li>
</ul>
</div>
<div class="NB-api-endpoint">
<h3><tt>GET /reader/favicons</tt></h3>
<a class="NB-anchor" name="favicons"> </a>
@ -134,9 +152,9 @@
<h4>Example Response</h4>
<pre><code>
{
{
'feeds': []
}
}
</code></pre>
<h4>Tips</h4>
@ -144,12 +162,14 @@
<ul>
<li>To use inline data images, you can use this syntax:
<pre><code>
&lt;img src="data:image/png;base64,[IMAGE_DATA_STRING]" /&gt;
&lt;img src="data:image/png;base64,[IMAGE_DATA_STRING]" /&gt;
</code></pre>
</li>
</ul>
</div>
<div class="NB-api-endpoint">
<h3><tt>GET /reader/page/:id</tt></h3>
<a class="NB-anchor" name="feed_page"> </a>
@ -160,16 +180,36 @@
<h4>Example Response</h4>
<pre><code>
{# <html> #}
{# <head> #}
{# <base href="http://www.newsblur.com" /> #}
{# <title>Proxied Page</title> #}
{# </head> #}
{# <body> #}
{# <p>This is a proxied page. This is straight HTML.</p> #}
{# </body> #}
{# </html> #}
{# <html> #}
{# <head> #}
{# <base href="http://www.newsblur.com" /> #}
{# <title>Proxied Page</title> #}
{# </head> #}
{# <body> #}
{# <p>This is a proxied page. This is straight HTML.</p> #}
{# </body> #}
{# </html> #}
</code></pre>
</div>
<div class="NB-api-endpoint">
<h3><tt>GET /reader/refresh_feeds</tt></h3>
<a class="NB-anchor" name="refresh_feeds"> </a>
<ul>
<li>Up-to-the-second unread counts for each active feed.</li>
<li>Poll for these counts no more than once a minute.</li>
</ul>
<h4>Example Response</h4>
<pre><code>
{
'feeds': []
}
</code></pre>
</div>
</div>
</div>
@ -185,6 +225,7 @@
<div class="NB-module-content">
<div class="NB-api-endpoint">
<h3><tt>GET /reader/feed/:id</tt></h3>
<a class="NB-anchor" name="feed"> </a>
@ -210,13 +251,14 @@
<h4>Example Response</h4>
<pre><code>
{
{
'feeds': []
}
}
</code></pre>
</div>
<div class="NB-api-endpoint">
<h3><tt>GET /reader/starred_stories</tt></h3>
<a class="NB-anchor" name="starred_stories"></a>
@ -242,12 +284,14 @@
<h4>Example Response</h4>
<pre><code>
{
{
'feeds': []
}
}
</code></pre>
</div>
<div class="NB-api-endpoint">
<h3><tt>GET /reader/river_stories</tt></h3>
<a class="NB-anchor" name="river_stories"> </a>
@ -280,11 +324,11 @@
<h4>Example Response</h4>
<pre><code>
{
{
'feeds': []
}
}
</code></pre>
</div>
</div>
</div>
@ -298,7 +342,8 @@
<h5 class="NB-module-title">Intelligence</h5>
<div class="NB-module-content">
<div class="NB-api-endpoint">
</div>
</div>
</div>