TheyWorkForYou.com API Bindings for PHP and ASP.NET
TheyWorkForYou.com is a "non-partisan, volunteer-run website which aims to make it easy for people to keep tabs on their elected and unelected representatives in Parliament."
The API allows access to information contained in the web site including lists of MPs, Lords and Hansard content. Bindings allow easy access to this API to retrieve data in the relevant programming language. Bindings for Ruby, Perl and Java are available from the API site, and I have authored bindings for PHP and ASP.NET, two commonly-used languages in web programming.
Both bindings have been tested and are known to work, however they may have some bugs.
NOTE: The current bindings now require API keys to access the TheyWorkForYou.com API. Dropping these new bindings into an existing application will break it until you amend your code and provide a valid API key.
PHP binding
The PHP API binding allows easy access to the API for applications written in PHP. It requires a minimum of PHP 5 (will not work with PHP 4) and cURL to be installed.
The PHP binding is very easy to use. Here is an example which uses the binding to get a list of all Labour MPs in the House of Commons from the API in XML format. You can also see it in action.
ASP.NET binding
NOTE: As of version 1.3, the ASP.NET binding now works as expected. Users of previous versions may receive errors related to invalid output types. All users are urged to upgrade to the latest version of the binding.
The ASP.NET API binding allows easy access to the API for applications written in ASP.NET/C#. Since it is written in C#, it can be run either under Windows/IIS or Linux/Mono without any modifications.
The ASP.NET binding is very easy to use. Here is an example which uses the binding to get a list of all Labour MPs in the House of Commons from the API in XML format.
Have any questions or bug reports? Contact me.
