Created
September 25, 2011 14:56
-
-
Save insom/1240681 to your computer and use it in GitHub Desktop.
Tag yourself as having gone to PyConUK 2011
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import fluidinfo, sys | |
u, p = sys.argv[1:] | |
f = fluidinfo.login(u, p) | |
fluidinfo.call('POST', '/tags/' + u, dict(name='attended', | |
description='Things that I have been to', indexed=False)) | |
fluidinfo.call('PUT', '/about/pyconuk 2011/' + u + '/attended', '2011-09-24') | |
print fluidinfo.call('GET', '/about/pyconuk 2011') | |
# might print something like - ({'status': '200', 'content-length': '116', | |
# 'content-location': 'https://fluiddb.fluidinfo.com/about/pyconuk%202011', | |
# 'server': 'nginx/0.7.65', 'connection': 'keep-alive', 'cache-control': | |
# 'no-cache', 'date': 'Sun, 25 Sep 2011 14:54:11 GMT', 'content-type': | |
# 'application/json'}, {u'tagPaths': [u'insom/attended', u'ejrowley/attended', | |
# u'fluiddb/about'], u'id': u'81e4382a-db60-4fb0-a32d-2d4e0e147a32'}) |
line 5/6 should be
fluidinfo.call('POST', '/tags/'+u, dict(name='attended', description='Things that I have been to'))
Fixed! Thanks. This is what happens when you lay into the repl to try and get something working, instead of reading the docs :)
Ooops
It should be:
fluidinfo.call('POST', '/tags/'+u, dict(name='attended', description='Things that I have been to', indexed=False))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ pip install fluidinfo.py
$ python attended-pyconuk.py <yourusername> <yourpassword> # signup at http://www.fluidinfo.com/