Skip to content

Instantly share code, notes, and snippets.

@kimihito
Created July 28, 2012 14:29
Show Gist options
  • Save kimihito/3193607 to your computer and use it in GitHub Desktop.
Save kimihito/3193607 to your computer and use it in GitHub Desktop.
pickup books in mybookself of booklog
#!/usr/bin/env python
# coding: utf-8
import urllib
import json
booklogID = "YOUR_BOOKLOG_ID"
url = 'http://api.booklog.jp/json/%s?category&status=1&category=0&count=1000'% booklogID
f = urllib.urlopen(url)
obj = json.load(f)
books = obj['books']
txt = open('wanna1.txt','w')
for book in books:
txt.write(book['title'].encode('utf-8'))
txt.write(book['author'].encode('utf-8'))
txt.write(book['asin'].encode('utf-8'))
print 'finished'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment