Permalink
Browse files

Added a usage and simple example to the readme

  • Loading branch information...
1 parent 5417974 commit 8a6fcd9f49b690cf8e2aa50e6bded5e1f2c8f552 @bnmrrs committed Aug 18, 2010
Showing with 16 additions and 0 deletions.
  1. +16 −0 README.md
View
16 README.md
@@ -9,6 +9,22 @@ scrae pages. Currently this package can only be used for reading.
$ sudo python setup.py install
+## Usage
+
+### Get distance
+A simple example for getting the total distance a user has covered
+
+<pre><code>from runkeeper import User
+
+user = User("bnmrrs")
+activities = user.get_all_activities()
+
+total_distance = 0
+for activity in activities:
+ total_distance += activity.get_distance()
+
+print "%dkm" % total_distance</code></pre>
+
## Dependencies
[Beautiful Soup](http://www.crummy.com/software/BeautifulSoup/)
[simplejson](http://www.undefined.org/python/)

0 comments on commit 8a6fcd9

Please sign in to comment.