whatser 0.3.1 → 0.3.2
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.rdoc +2 -1
- data/VERSION +1 -1
- data/lib/whatser/api/facebook.rb +7 -5
- data/lib/whatser/api/foursquare.rb +6 -0
- data/lib/whatser/api/twitter.rb +8 -6
- data/test/test_facebook.rb +5 -1
- data/test/test_foursquare.rb +5 -1
- data/test/test_twitter.rb +5 -1
- data/whatser.gemspec +1 -1
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -299,10 +299,11 @@ The Twitter and Facebook classes allow for content publishing, meaning status tw
|
|
299
299
|
Whatser.client.facebook.wall_post(:name => 'my link', :link => 'http://example.com', :caption => 'click this link', :description => 'summary here', :picture => 'http://example.com/img/whatser.png', :user_id => '101,201,33')
|
300
300
|
Whatser.client.twitter.status_update('tweeting!', :lat => 52.3665312, :long => 4.8931739, :display_coordinates => true, :place_id => twitter_places_id)
|
301
301
|
|
302
|
-
When a user connects a social network account to the Whatser API, their friends are automatically imported at this time. To keep a user's friends updated, you can call a get_friends method on the Twitter and Facebook classes to import any new friends of that user who have recently registered with Whatser. Note, only newly imported friends are returned.
|
302
|
+
When a user connects a social network account to the Whatser API, their friends are automatically imported at this time. To keep a user's friends updated, you can call a get_friends method on the Twitter, Foursquare, and Facebook classes to import any new friends of that user who have recently registered with Whatser. Note, only newly imported friends are returned.
|
303
303
|
|
304
304
|
Whatser.client.facebook.get_friends
|
305
305
|
Whatser.client.twitter.get_friends
|
306
|
+
Whatser.client.foursquare.get_friends
|
306
307
|
|
307
308
|
You can use convenience methods on users and spots to determine their connections to external networks.
|
308
309
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/lib/whatser/api/facebook.rb
CHANGED
@@ -2,12 +2,14 @@ module Whatser
|
|
2
2
|
class Facebook < Whatser::Service
|
3
3
|
@key = 'facebook'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
class << self
|
6
|
+
def get_friends(opts={})
|
7
|
+
api_request :get, "/oauth/services/facebook/friends", {:query => opts}, :model => Whatser::User
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
def wall_post(params={})
|
11
|
+
api_request :post, "/oauth/services/facebook/publish", {:body => params}
|
12
|
+
end
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
data/lib/whatser/api/twitter.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
module Whatser
|
2
2
|
class Twitter < Whatser::Service
|
3
3
|
@key = 'twitter'
|
4
|
+
|
5
|
+
class << self
|
6
|
+
def get_friends(opts={})
|
7
|
+
api_request :get, "/oauth/services/twitter/friends", {:query => opts}, :model => Whatser::User
|
8
|
+
end
|
4
9
|
|
5
|
-
|
6
|
-
|
10
|
+
def status_update(status, params={})
|
11
|
+
api_request :post, "/oauth/services/twitter/publish", {:body => {'status' => status}.merge(params) }
|
12
|
+
end
|
7
13
|
end
|
8
|
-
|
9
|
-
def status_update(status, params={})
|
10
|
-
api_request :post, "/oauth/services/twitter/publish", {:body => {'status' => status}.merge(params) }
|
11
|
-
end
|
12
14
|
end
|
13
15
|
end
|
data/test/test_facebook.rb
CHANGED
@@ -10,7 +10,11 @@ class TestFacebook < Test::Unit::TestCase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_connection_url
|
13
|
-
expected = "#{@client.api_uri}/oauth/services/facebook/authorize"
|
13
|
+
expected = "#{@client.api_uri}/oauth/services/facebook/authorize?redirect_uri=&client_id="
|
14
14
|
assert_equal expected, @client.facebook.connection_url
|
15
15
|
end
|
16
|
+
|
17
|
+
def test_get_friends
|
18
|
+
assert @client.facebook.get_friends(:opt => 'test').is_a?(Whatser::Response)
|
19
|
+
end
|
16
20
|
end
|
data/test/test_foursquare.rb
CHANGED
@@ -10,7 +10,11 @@ class TestFoursquare < Test::Unit::TestCase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_connection_url
|
13
|
-
expected = "#{@client.api_uri}/oauth/services/foursquare/authorize"
|
13
|
+
expected = "#{@client.api_uri}/oauth/services/foursquare/authorize?redirect_uri=&client_id="
|
14
14
|
assert_equal expected, @client.foursquare.connection_url
|
15
15
|
end
|
16
|
+
|
17
|
+
def test_get_friends
|
18
|
+
assert @client.foursquare.get_friends(:opt => 'test').is_a?(Whatser::Response)
|
19
|
+
end
|
16
20
|
end
|
data/test/test_twitter.rb
CHANGED
@@ -10,7 +10,11 @@ class TestTwitter < Test::Unit::TestCase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_connection_url
|
13
|
-
expected = "#{@client.api_uri}/oauth/services/twitter/authorize"
|
13
|
+
expected = "#{@client.api_uri}/oauth/services/twitter/authorize?redirect_uri=&client_id="
|
14
14
|
assert_equal expected, @client.twitter.connection_url
|
15
15
|
end
|
16
|
+
|
17
|
+
def test_get_friends
|
18
|
+
assert @client.twitter.get_friends(:opt => 'test').is_a?(Whatser::Response)
|
19
|
+
end
|
16
20
|
end
|
data/whatser.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whatser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Travis Dunn
|