Skip to content

Instantly share code, notes, and snippets.

@ptu
Created March 8, 2014 17:12
Show Gist options
  • Save ptu/9435194 to your computer and use it in GitHub Desktop.
Save ptu/9435194 to your computer and use it in GitHub Desktop.
Thingstore API Random Data
import requests
from random import randint
METRIC = 'Dummy'
THINGID = 3
APITOKEN = 'apitoken_dev'
THINGSTORE_URL = 'http://localhost:8000'
randomthingdata = METRIC + ',' + str(randint(0,100))
uri = THINGSTORE_URL + '/api/thing/' + str(THINGID) + '.csv?apikey=' + APITOKEN
r = requests.put(uri, randomthingdata)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment