source: make_isbn_list.py @ 26:4af842589412

Revision 26:4af842589412, 603 bytes checked in by hagenbruch@phoibe.ub.rub.de, 7 years ago (diff)

Added auto-suggest and linked data mashup; leafing through single hits is now independent of position in result list (i.e. an entry can be bookmarked as is); further improvements...

Line 
1#!/usr/bin/env python
2# encoding: utf-8
3"""
4make_isbn_list.py
5
6Created by Andre Hagenbruch on 2009-11-20.
7Copyright (c) 2009 University Library Bochum. All rights reserved.
8"""
9
10from urllib import urlopen
11
12def get_data():
13        isbns = set()
14        result = eval(urlopen('http://134.147.247.36:8983/solr/select/?q=*:*&rows=15000&fl=isbn&wt=python').read())
15        docs = result['response']['docs']
16        for doc in docs:
17                #print docs
18                for isbn in doc.get('isbn', ''):
19                        isbns.add(isbn)
20        return isbns
21
22def main():
23        isbns = get_data()
24        print len(isbns)
25        for isbn in isbns:
26                print isbn
27       
28if __name__ == '__main__':
29        main()
30
Note: See TracBrowser for help on using the repository browser.