def path_decoder(url):
    """Grab the last component of a url as the path."""
    components = url.split('/')
    if components[-1]:
        return components[-1]
    else:
        return components[-2]