http://www.christophermanning.org/writing/save-scraperwiki-data-to-local-sqlite-database/
Last active
September 27, 2015 23:58
-
-
Save christophermanning/1352719 to your computer and use it in GitHub Desktop.
Save ScraperWiki Data to Local SQLite Database
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
try : import json | |
except: import simplejson as json | |
import sys | |
import os | |
import datalib | |
import time | |
sqlite_db = None | |
def request(request): | |
global sqlite_db | |
if sqlite_db is None: | |
sqlite_db = datalib.SQLiteDatabase(None, os.getcwd(), os.path.splitext(os.path.basename(sys.argv[0]))[0], None, str(time.time()), None) | |
return sqlite_db.process(request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment