scraperwiki / odata-cgi

1 stars 0 forks source link

Odata refresh is run multiple times on connection and refresh from Tableau #14

Open IanHopkinson opened 10 years ago

IanHopkinson commented 10 years ago

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

IanHopkinson commented 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)