Using ASE with your.flowingdata

As of ASE r16, python-twitter is included with Python. There is a bug that prevents it from working (the fix will be available in r17). But, there's a work around:
  1. Open ASE shell (Menu > Interpreters > Shell)
  2. Type mkdir /sdcard/ase/python/tmp
I'm using the python-twitter module to make it easy to keep track of events on your.flowingdata (yfd). I have the following yfd.py script:
import android
import twitter
droid = android.Android()
t = twitter.Api(username='foo', password='bar')

def yfd(data=None):
  if data is None:
    data = droid.getInput('d yfd')['result']
  if data:
    t.PostDirectMessage('yfd', data)
  droid.exit()

if __name__ == '__main__':
  yfd()
Then, I have a few shortcut scripts I use for common data entries. For example, goodmorning:
import yfd
yfd.yfd('goodmorning')
and goodnight:
import yfd
yfd.yfd('goodnight')
On my Nexus One, I created a folder on my home screen called "yfd" that contains shortcuts to all three scripts. Just before bed, I tap "goodnight.py" and I tapp "goodmorning.py" when I wake up. If I have a data point to enter that isn't pre-defined, I tap "yfd.py" and enter my data.

Works like a champ.

1 comment:

  1. A nice simple method, thanks for sharing! I've always need afraid of accidentally forgetting to put the d in the post.

    Do you still use yfd.?

    ReplyDelete