Tasker recording weight for android

June 14, 2011 at 11:49 pm Leave a comment

Tasker task

The following code will record your weight to a cgi script on a server that you have.

	
		Weight
		15
		
			
				
			
			
				
			
			
				10
			
			
				%WEIGHT
			
			
				
			
			
				my.url.com
			
			116
		
		10
		
			
				
			
			
				
			
			
				
			
			
				3
			
			
				Weight
			
			
				%WEIGHT
			
			595
		
		
			package_graphics
			net.dinglisch.android.ipack.crystalhd
		
	


Modify this to point at your server, which has the following cgi script

#!/usr/bin/python

import cgi
import os
import sys
import datetime

print 'Content-Type: text/plain\n\n',

method = os.environ['REQUEST_METHOD']

if method == 'GET':
        print file('data').read()
elif method == 'POST':
        f = file('data', 'a')
        try:
                f.write(datetime.datetime.now().isoformat())
                f.write(' ')
                f.write(sys.stdin.read())
                f.write('\n')
        finally:
                f.close()
else:
        raise Exception('Bad method')

Caveats

Needs a server
Privacy through obscurity

Advantages

Easy data syncing.

You can create a link to this task on your phone-top.

Advertisements

Entry filed under: Uncategorized. Tags: .

R cheat sheet R – The perl of statistics

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


June 2011
M T W T F S S
« May   Jul »
 12345
6789101112
13141516171819
20212223242526
27282930  

%d bloggers like this: