Skip to content

Commit

Permalink
add pointers to raw data from API help and FAQ
Browse files Browse the repository at this point in the history
Should hopefully cut down on some user support questions.

Fixes #1730
  • Loading branch information
struan authored and dracos committed Jul 5, 2023
1 parent fd4dbdc commit 68d29f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion www/docs/api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function api_front_page($error = '') {
<p>The <em>output</em> argument can take any of the following values:
<ul>
<li><strong>xml</strong>. XML. The root element is twfy.</li>
<li><strong>php</strong>. Serialized PHP, that can be turned back into useful information with the unserialize() command. Quite useful in Python as well, using <a href="http://hurring.com/code/python/serialize/">PHPUnserialize</a>.</li>
<li><strong>php</strong>. Serialized PHP, that can be turned back into useful information with the unserialize() command. Quite useful in Python as well, using e.g. <a href="https://pypi.org/project/phpserialize/">phpserialize</a>.</li>
<li><strong>json</strong>. JSON data.</li>
<li><strong>js</strong>. A JavaScript object, with data in ISO-8859-1. You can
provide a callback function with the <em>callback</em> variable, and then that
Expand Down Expand Up @@ -296,6 +296,13 @@ function will be called with the data as its argument.</li>
<li><a href="javascript:function foo(r) {if (r.twfy.url)window.location=r.twfy.url;};(function () {var s=document.createElement('script');s.setAttribute('src','https://www.theyworkforyou.com/api/convertURL?key=Gbr9QgCDzHExFzRwPWGAiUJ5&callback=foo&url='+encodeURIComponent(window.location));s.setAttribute('type','text/javascript');document.getElementsByTagName('head')[0].appendChild(s);})()">Hansard prettifier</a> - drag this bookmarklet to your bookmarks bar, or bookmark it. Then if you ever find yourself on the official site, clicking this will try and take you to the equivalent page on TheyWorkForYou. (Tested in IE, Firefox, Opera.)</li>
</ul>

<h3>Bulk Analysis</h3>

<p>
If you are doing analysis over long periods of time, or generating statistical data then you might find our <a href="https://parser.theyworkforyou.com/">raw data</a>
more suitable that using the API.
</p>

<?php
$sidebar = api_sidebar($subscription);
$PAGE->stripe_end(array($sidebar));
Expand Down
7 changes: 6 additions & 1 deletion www/includes/easyparliament/templates/html/static/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</h3>
<p>
In 2020, we removed some statistics from MPs' individual pages.
You can read an explanation in <a href="http://mysociety.org/?p=47612">this blog post</a>.
You can read an explanation in <a href="https://www.mysociety.org/2020/11/16/publishing-less-our-current-thinking-about-comparative-statistics/">this blog post</a>.
</p>
Expand Down Expand Up @@ -325,6 +325,11 @@
And lots more &ndash; see the whole list on the <a href="/api">API page</a>.
</p>
<p>
If you are doing large scale analysis of our data, e.g. all uses of a term over a Parliamentary session, then you
will probably find our <a href="https://parser.theyworkforyou.com/">raw data</a> more suitable than the API.
</p>
<h3 class="js-toc-item" id="use">How do people use TheyWorkForYou?</h3>
<p>Here are some quotes from our users.</p>
Expand Down

0 comments on commit 68d29f0

Please sign in to comment.