runkeeper 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +7 -1
- data/lib/runkeeper/activity.rb +1 -1
- data/lib/runkeeper/configuration.rb +2 -2
- data/lib/runkeeper/user.rb +4 -0
- data/lib/runkeeper/version.rb +1 -1
- metadata +2 -2
data/README.markdown
CHANGED
@@ -4,6 +4,12 @@
|
|
4
4
|
## Example
|
5
5
|
user = Runkeeper.new("user token")
|
6
6
|
puts user.name
|
7
|
-
activity = user.new_activity(:duration => 60, :type => "Swimming", :distance => 1000
|
7
|
+
activity = user.new_activity(:duration => 60, :type => "Swimming", :distance => 1000)
|
8
8
|
activity.save
|
9
9
|
puts user.activity_url(activity)
|
10
|
+
|
11
|
+
## Generating a token
|
12
|
+
$ gem install launchy rack
|
13
|
+
$ CLIENT_ID="your client id" CLIENT_SECRET="your secret" AUTHORIZATION_URL="https://runkeeper.com/apps/authorize" ACCESS_TOKEN_URL="https://runkeeper.com/apps/token" token_generator
|
14
|
+
Use your browser to allow access
|
15
|
+
Then check your console for the token
|
data/lib/runkeeper/activity.rb
CHANGED
@@ -2,7 +2,7 @@ class Runkeeper
|
|
2
2
|
|
3
3
|
class Activity
|
4
4
|
attr_reader :connection, :url
|
5
|
-
|
5
|
+
attr_accessor :type, :start_time, :total_distance, :duration, :average_heart_rate, :total_calories, :notes, :path, :post_to_facebook, :post_to_twitter
|
6
6
|
|
7
7
|
def initialize(connection, attrs)
|
8
8
|
@connection = connection
|
@@ -13,11 +13,11 @@ class Runkeeper
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def authorization_url
|
16
|
-
@authorization_url || ENV['AUTHORIZATION_URL']
|
16
|
+
@authorization_url || ENV['AUTHORIZATION_URL'] || "https://runkeeper.com/apps/authorize"
|
17
17
|
end
|
18
18
|
|
19
19
|
def access_token_url
|
20
|
-
@access_token_url || ENV['ACCESS_TOKEN_URL']
|
20
|
+
@access_token_url || ENV['ACCESS_TOKEN_URL'] || "https://runkeeper.com/apps/token"
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
data/lib/runkeeper/user.rb
CHANGED
data/lib/runkeeper/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: runkeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sandro Turriate
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-25 00:00:00 -06:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|