Skip to content

Instantly share code, notes, and snippets.

View jezhiggins's full-sized avatar

Jez Higgins jezhiggins

View GitHub Profile
0xcc2d6ea8ad9c529490a936087fea24acede0acfc
@jezhiggins
jezhiggins / mapit-es6-stylee.js
Last active May 11, 2017 12:31 — forked from pezholio/mapit.js
Getting parliamentary constituencies from MapIt
const Client = require('node-rest-client').Client;
const postcode = 'SW1A1AA'; // Or whatever postcode you're looking for
const uri = `https://mapit.mysociety.org/postcode/${postcode}`;
const getConstituency = uri => new Promise((resolve, error) =>
{
const client = new Client();
client.get(uri, (data, response) => {
constituencyCode = data.shortcuts.WMC;