Skip to content

Instantly share code, notes, and snippets.

<?php
function lookuppostcode($postcode) {
$postcode = str_replace(" ", "", $postcode);
$key = 'YOUR_API_KEY';
$request = 'https://api.getAddress.io/v2/uk/' . $postcode . '?api-key=' . $key;
$response = file_get_contents($request);
$response = json_decode($response, true);
$returnData = array();
@tilnothing
tilnothing / gist:f4182e201acaa3eb202b
Last active August 29, 2015 14:27 — forked from davidwtbuxton/gist:2780839
Bottle route traversal
# Demonstration of inspecting all the routes, including those on sub-apps,
# from the default app instance.
#
# This should be run directly to print a list of route prefixes and the rules.
# Tested with Python 2.7 and Bottle-dev. Patch here
# https://github.com/davidwtbuxton/bottle/commit/ddd712ef252b06ecd0e957f8ac4e37b65ee79cae
import bottle
subapp = bottle.Bottle()