diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/help/api.rhtml | 35 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 3 | ||||
-rw-r--r-- | app/views/request/details.rhtml | 3 |
3 files changed, 34 insertions, 7 deletions
diff --git a/app/views/help/api.rhtml b/app/views/help/api.rhtml index f984bed4d..6f34755b2 100644 --- a/app/views/help/api.rhtml +++ b/app/views/help/api.rhtml @@ -14,7 +14,9 @@ interact with WhatDoTheyKnow via an "API". lots of things that are similar in use to an API as they are requested. </p> -<h2> Linking to new requests </h2> +<hr> + +<h2> 1. Linking to new requests </h2> <p>To encourage your users to make links to a particular public authority, use URLs of the form <%= link_to new_request_to_body_url(:url_name => "liverpool_city_council") , new_request_to_body_url(:url_name => "liverpool_city_council") %>. @@ -27,18 +29,39 @@ These are the parameters you can add to those URLs, either in the URL or from a <li> <strong>tags</strong> - space separated list of tags, so you can find and link up any requests made later, e.g. <em>openlylocal spending_id:12345</em>. The : indicates it is a machine tag. The values of machine tags may also include colons, useful for URIs. </ul> -<h2> RSS (actually, Atom) feeds </h2> +<hr> + +<h2> 2. RSS (actually, Atom) feeds </h2> <p>There are Atom feeds throughout the site, which you can use to get updates -and links in XML format. +and links in XML format. Find the URL of the Atom feed in one of these ways: +<ul> + <li>Look for the <img src="/images/feed-16.png" alt=""> RSS feed links.</li> + <li>Examine the <tt><link rel="alternate" type="application/atom+xml"></tt> tag in the head of the HTML. </li> + <li>Add <tt>/feed</tt> to the start of another URL. +</ul> -<p>In particular, search queries, however complicated, all have Atom feeds. +<p>In particular, even complicated search queries have Atom feeds. You can do all sorts of things with them, such as query by authority, by file -type, by date range, by status. See the <a href="/search">advanced search +type, by date range, or by status. See the <a href="/search">advanced search tips</a> for details. -<dl> +<hr> + +<h2> 3. JSON structured data </h2> + +<p>Request and public authority pages have JSON feeds, which let you download +information about objects in a structured form. Find them by: +<ul> + <li>Adding <tt>.json</tt> to the end of the URL. </li> + <li>Look for the <tt><link rel="alternate" type="application/json"></tt> tag in the head of the HTML. </li> +</ul> +</p> + +<hr> +<p>Please <a href="/help/contact">contact us</a> if you need an API feature that isn't there yet. It's +very much a work in progress, and we do add things when people ask us to.</p> <div id="hash_link_padding"></div> diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index c5466964d..ca8904005 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -30,6 +30,9 @@ <link rel="alternate" type="application/atom+xml" title="<%=h feed[:title] %>" href="<%=h feed[:url]%>"> <% end %> <% end %> + <% if @has_json %> + <link rel="alternate" type="application/json" title="JSON version" href="<%=h main_url(request.request_uri) %>.json"> + <% end %> <% if @no_crawl %> <meta name="robots" content="noindex, nofollow"> diff --git a/app/views/request/details.rhtml b/app/views/request/details.rhtml index db7e652f6..03e5148ef 100644 --- a/app/views/request/details.rhtml +++ b/app/views/request/details.rhtml @@ -51,4 +51,5 @@ the most recent event had its status updated to that value. <strong>calculated</ WhatDoTheyKnow for intermediate events, which weren't given an explicit description by a user. See the <a href="/search">search tips</a> for description of the states.</p> - +<p>You can get this page in computer-readable format as part of the main JSON +page for the request. See the <a href="/help/api">API documentation</a>.</p> |