NewsBlur/templates/static/api.xhtml

148 lines
5.4 KiB
HTML
Raw Normal View History

{% extends 'base.html' %}
{% block bodyclass %}NB-static NB-static-api{% endblock %}
2011-04-23 18:22:52 -04:00
{% block title %}The NewsBlur API{% endblock %}
{% block content %}
<div class="NB-static-title">
The NewsBlur API
</div>
2011-04-23 18:22:52 -04:00
<div class="NB-module">
<h5 class="NB-module-title">Introduction to the API</h5>
<div class="NB-module-content">
<p><a href="/">NewsBlur</a> is an RSS feed reader with intelligence.</p>
<p>NewsBlur's API allows users to retrieve their feeds, feed counts, feed icons, feed
statistics, and individual feed stories. No API key is required, but you are required
to authenticate before using any of the API endpoints. Please be considerate, and don't
hammer our servers.</p>
<p>It is a very nice thing to note that this entire API is open-source, including
the implementation of the endpoints. You can find the source of the
<a href="http://github.com/samuelclay/NewsBlur/tree/master/apps/reader/views.py">/reader/ views</a>,
<a href="http://github.com/samuelclay/NewsBlur/tree/master/apps/rss_feeds/views.py">/rss_feeds/ views</a>,
as well as
<a href="http://github.com/samuelclay/NewsBlur/tree/master/templates/static/api.yml">the API definitions in YML</a>.</p>
2011-04-23 18:22:52 -04:00
</div>
</div>
{# ========= #}
{# = Feeds = #}
{# ========= #}
<div class="NB-module">
2011-04-21 22:36:26 -04:00
<h5 class="NB-module-title">API Table of Contents</h5>
2011-04-23 18:22:52 -04:00
<div class="NB-module-content">
2011-04-22 10:05:22 -04:00
<div class="NB-api-endpoint">
{% for group in data %}{% for group_name, endpoints in group.items %}
<div class="NB-api-toc-header">{{ group_name }}</div>
<ul class="NB-api-toc">
{% for endpoint in endpoints %}
<li>
<div class="NB-api-link-desc">{{ endpoint.short_desc }}</div>
<a href="#{{ endpoint.url }}">{{ endpoint.method }} <code>{{ endpoint.url }}</code></a>
</li>
{% endfor %}
</ul>
{% endfor %}{% endfor %}
2011-04-22 10:05:22 -04:00
</div>
</div>
</div>
2011-04-21 22:36:26 -04:00
{% for group in data %}{% for group_name, endpoints in group.items %}
<div class="NB-module">
<h5 class="NB-module-title">{{ group_name }}</h5>
<div class="NB-module-content">
{% for endpoint in endpoints %}
<div class="NB-api-endpoint">
<h3><tt>{{ endpoint.method }} {{ endpoint.url }}</tt></h3>
<a class="NB-anchor" name="{{ endpoint.url }}"></a>
{% if endpoint.long_desc %}
<ul>
{% for desc in endpoint.long_desc %}
<li>{{ desc|safe }}</li>
{% endfor %}
</ul>
{% endif %}
{% if endpoint.params %}
<table>
<tr>
<th>Parameter</th>
<th>Description</th>
<th>Default</th>
<th>Example</th>
</tr>
{% for param in endpoint.params %}
<tr>
<td>{{ param.key }}</td>
<td class="NB-api-endpoint-param-desc">
{% if param.optional %}
<span class="optional">Optional</span>
{% else %}{% if param.required %}
<span class="required">Required</span>
{% endif %}{% endif %}
{{ param.desc|safe }}
</td>
<td>{% if param.default %}<code>{{ param.default }}</code>{% endif %}</td>
<td><code>{{ param.example|safe }}</code></td>
</tr>
{% endfor %}
</table>
{% endif %}
{# <h4>Example Response</h4> #}
{# <pre><code> #}
{# { #}
{# 'feeds': [] #}
{# } #}
{# </code></pre> #}
{% if endpoint.tips %}
<h4>Tips</h4>
<ul>
{% for tip in endpoint.tips %}
<li>{{ tip|safe }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
2011-04-22 10:05:22 -04:00
</div>
</div>
{% endfor %}{% endfor %}
2011-04-21 22:36:26 -04:00
{# ===================== #}
{# = Terms of Services = #}
{# ===================== #}
<div class="NB-module">
<h5 class="NB-module-title">API Guidelines and Terms of Service</h5>
<div class="NB-module-content">
<p>NewsBlur's API allows users to retrieve their feeds, feed counts, feed icons, feed
statistics, and individual feed stories. No API key is required, but you are required
to authenticate before using any of the API endpoints. Please be considerate, and don't
hammer our servers.</p>
<p>If your project or application allows users to interact with data from NewsBlur,
you must cite NewsBlur as the source of your data.</p>
<p>You may use the API commercially, by which we mean you may charge people money to
use your project which itself uses the API. You may not, however, sell advertising
against any data retrieved from NewsBlur's API. Essentially, you can charge money for
your application or service, but not wrap NewsBlur in advertisements.</p>
<p><i>We reserve the right to revise these guidelines. If you violate the spirit of
these terms, expect to be blocked without advance warning.</i></p>
</div>
</div>
{% endblock content %}