(url)
return res
Return a list of snapshots for a given url
Return a list of snapshots for a given url
Return a list of snapshots for a given url
def snapshots(url):
        """
        Return a list of snapshots for a given url
        """
        # FIXME: report more snapshot through the Memento API
        r = requests.get('http://archive.org/wayback/available?url=%s' %
                urllib.parse.quote(url))
        data = r.json()
        res = []
        if 'archived_snapshots' in data:
            for i in data['archived_snapshots']:
                res.append({
                    'url': data['url'],
                    'archive': data['archived_snapshots'][i]['url'],
                    'date': parse(data['archived_snapshots'][i]['timestamp'])
                })
        return res
def snapshots ( url ) : # FIXME: report more snapshot through the Memento API r = requests . get ( 'http://archive.org/wayback/available?url=%s' % urllib . parse . quote ( url ) ) data = r . json ( ) res = [ ] if 'archived_snapshots' in data : for i in data [ 'archived_snapshots' ] : res . append ( { 'url' : data [ 'url' ] , 'archive' : data [ 'archived_snapshots' ] [ i ] [ 'url' ] , 'date' : parse ( data [ 'archived_snapshots' ] [ i ] [ 'timestamp' ] ) } ) return res