Created
July 28, 2012 14:29
-
-
Save kimihito/3193607 to your computer and use it in GitHub Desktop.
pickup books in mybookself of booklog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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