Re: [guardian-api-talk] Re: Possible bug: Politics API returns truncated (invalid) JSON response for Conservative party mp listing

50 views
Skip to first unread message

Michael Brunton-Spall

unread,
Nov 12, 2012, 6:43:13 AM11/12/12
to Guardian API Talk
Thanks for sending that information through.

I double checked and also saw the issue, although it being 1AM locally at the time I wasn't able to look at it or address it.

I'll pass onto the politics team and see if we know what could have caused it, it's a bit of a mystery to me as to how it can possibly happen.

With regard to finding an MP by name, unfortunately for some reason we don't expose all politicians, or a way of looking up by name, but I'll add that to our backlog as it should be possible to combine the Content-Api and Politics API to do that for most politicians fairly easily.

Thanks again

Michael Brunton-Spall
Developer Advocate
guardian.co.uk


On 11 November 2012 23:20, Tom Lant <lamph...@gmail.com> wrote:
Well, this now seems to be working. So either we had a Sunday bugfix, an intermittent issue, or I am a crank?

Either way, we can probably disregard what I said before, at least for now.

Tom


On Sunday, 11 November 2012 00:51:36 UTC, Tom Lant wrote:
Hi there,

Is this a suitable place to post bug reports? I wasn't able to find a more appropriate link from the main site.

Anyway, I've noticed that when trying to fetch a list of Conservative MPs using the politics API, it seems to return invalid, truncated JSON.

Hitting:

    http://www.guardian.co.uk/politics/api/party/59/json


Returns mps up to Stuart Andrew:



Additionally, can anyone advise if there is a cleaner way to search for an MP by name? Right now I'm looking at hitting the /party/all/json feed, then iterating through each party's page to build up a map of mp names to aristotle ids, which seems pretty clumsy :\

Thanks,

Tom

--
You received this message because you are subscribed to the Google Groups "Guardian API Talk" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/guardian-api-talk/-/6FgVe7Vu8I8J.

To post to this group, send an email to guardian...@googlegroups.com.
To unsubscribe from this group, send email to guardian-api-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/guardian-api-talk?hl=en-GB.

Please consider the environment before printing this email.
------------------------------------------------------------------
Visit guardian.co.uk - website of the year
 
www.guardian.co.uk    www.observer.co.uk     www.guardiannews.com 
 
On your mobile, visit m.guardian.co.uk or download the Guardian
iPhone app www.guardian.co.uk/iphone and iPad edition www.guardian.co.uk/iPad 
 
Save up to 37% by subscribing to the Guardian and Observer - choose the papers you want and get full digital access. 
Visit guardian.co.uk/subscribe
 
---------------------------------------------------------------------
This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
 
Guardian News & Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.
 
Guardian News & Media Limited
 
A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP
 
Registered in England Number 908396

Michael Brunton-Spall

unread,
Nov 19, 2012, 9:49:30 AM11/19/12
to Guardian API Talk
Cheers Stephen.

I've had a very quick look and for some reason our feed is uploading partially incomplete files to our static file server.  It re-uploads on a regular basis which explains why it fixed itself then broke again.
I'll try to have a look at why and fix it when I get a chance.

Thanks again

MBS

Michael Brunton-Spall
Developer Advocate
guardian.co.uk


On 19 November 2012 13:58, Stephen Rushe <st...@deeden.co.uk> wrote:
Just thought I'd add another couple of truncated entries to the list.

The json returned for both the 1992, and 2010 General Elections is also truncated if you hit one of:


The 1992 response is 2619 bytes, while the 2010 is 2644.

The files for 1997, 2001, and 2005, all seem to be complete.

Steve
 
On Friday, November 16, 2012 12:13:42 AM UTC, Tom Lant wrote:
Hi Michael,

Thanks for your reply.

Yeah, it does seem a bit mysterious, especially since it's intermittent =-) Unfortunately the issue does seem be affecting me again - I haven't been able to successfully fetch the full list of Conservative MPs today or yesterday.

I've also noticed that not all of the URLs provided by a call to http://www.guardian.co.uk/politics/api/party/all/json respond correctly - you get a 404 if you hit one of:

    http://www.guardian.co.uk/politics/api/party/15/json (Alliance Party of Northern Ireland)


That's not actually a significant issue for my use case, though.

Thanks for letting the Politics guys know - is there a more appropriate forum for bug reports?

Tom
To view this discussion on the web, visit https://groups.google.com/d/msg/guardian-api-talk/-/ZtPsHTapBnUJ.
Reply all
Reply to author
Forward
0 new messages