-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpubs2json.py
15 lines (12 loc) · 890 Bytes
/
pubs2json.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import json
import urllib
pubs = [26840485, 26548914, 26076426, 26025440, 25953808, 25848958, 25825834, 25799414, 25409504, 25387460, 25386338, 25371418, 25218180, 25179232, 25143291, 24995530, 24859302, 24812216, 24349448, 24213777, 24176582, 23818857, 23724086, 23613759, 23571589, 23558134, 23259572, 22864262, 22522955, 22186876, 23300833, 23082106, 21705601, 21793736, 21861847, 21565804, 21398548, 22174796, 20843733, 20565938, 20299126, 20105305, 19542273, 19716705, 19283063, 19015912, 19081724, 18366328, 17984072, 11825690, 11435081, 11011763, 9831592]
args = {'apikey' : '191d24f81e61c107bca103f7d6a9ca10',
'db' : 'pubmed',
'id' : ",".join([str(s) for s in pubs]),
'retmax' : 100,
'max' : 10,
'start' : 0}
params = urllib.urlencode(args)
f = urllib.urlopen("http://entrezajax.appspot.com/esummary?" + params)
print f.read()