whatser 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
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
1
+ 0.3.2
@@ -2,12 +2,14 @@ module Whatser
2
2
  class Facebook < Whatser::Service
3
3
  @key = 'facebook'
4
4
 
5
- def get_friends(opts={})
6
- api_request :get, "/oauth/services/facebook/friends", {:query => opts}, :model => Whatser::User
7
- end
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
- def wall_post(params={})
10
- api_request :post, "/oauth/services/facebook/publish", {:body => params}
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
@@ -1,5 +1,11 @@
1
1
  module Whatser
2
2
  class Foursquare < Whatser::Service
3
3
  @key = 'foursquare'
4
+
5
+ class << self
6
+ def get_friends(opts={})
7
+ api_request :get, "/oauth/services/foursquare/friends", {:query => opts}, :model => Whatser::User
8
+ end
9
+ end
4
10
  end
5
11
  end
@@ -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
- def get_friends(opts={})
6
- api_request :get, "/oauth/services/twitter/friends", {:query => opts}, :model => Whatser::User
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
@@ -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
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{whatser}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Travis Dunn"]
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: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Travis Dunn