Open IanHopkinson opened 10 years ago
Code to do this is just:
#!/usr/bin/env python
import scraperwiki
from random import randint
import datetime
import os
# Saving data:
unique_keys = [ 'datetime' ]
data = { 'datetime': datetime.datetime.now(), 'rand':randint(0,100), 'url': os.environ.get('REQUEST_URI')}
scraperwiki.sql.save(unique_keys, data)
The Odata refresh script is run 8 times on making the initial connection and then 3 times for each subsequent refresh. See the random number generator code in the browser tool, here:
https://scraperwiki.com/dataset/lfp0xmb/settings