Skip to content

Instantly share code, notes, and snippets.

@trtg
trtg / withings_example.py
Created June 3, 2012 09:21
A basic example of how to use pywithings
from withings import *
import matplotlib.pyplot as plt #for plotting weights
from datetime import datetime
from pandas import *
#-----------------------------------
#get your consumer key and secret after registering
#as a developer here: https://oauth.withings.com/en/partner/add
consumer_key='your_consumer_key_here_1111111111111111111111111111111111111111'
consumer_secret='your_consumer_secret_here_1111111111111111111111111111111111111111111'
@trtg
trtg / withings.py
Created June 3, 2012 09:26
The pywithings library implementation
import hashlib#for computing hash
from rauth.service import OAuth1Service #see https://github.com/litl/rauth for more info
import shelve #for persistent caching of tokens, hashes,etc.
#get your consumer key and secret after registering as a developer here: https://oauth.withings.com/en/partner/add
#FIXME add method to set default units and make it an optional argument to the constructor
class Withings:
def __init__(self,email_address,consumer_key,consumer_secret,cache_name='tokens.dat'):
if email_address == None:
@trtg
trtg / _.md
Created October 15, 2012 07:42
how to serialize d3 svgs
@trtg
trtg / _.md
Created October 15, 2012 08:32
drawing circles and using groups in d3
@trtg
trtg / _.md
Created October 15, 2012 11:45
d3 transitions with bar graphs
@trtg
trtg / _.md
Created October 15, 2012 12:06
plotting line paths with d3
@trtg
trtg / _.md
Created October 15, 2012 20:53
plotting bars in a zeo sleep graph with d3
@trtg
trtg / _.md
Created October 19, 2012 07:13
using stack layout in d3
@trtg
trtg / _.md
Created October 20, 2012 08:30
move element to front on mouseover in d3
@trtg
trtg / _.md
Created October 20, 2012 09:14
move circle along path in d3