whatser 0.3.0 → 0.3.1

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 CHANGED
@@ -133,6 +133,10 @@ A spot is a named geographical location and the most fundamental kind of content
133
133
  m = Whatser.client.spots.new( :name => 'my spot', :lat => 52.0, :lng => 4.0 )
134
134
  m.save
135
135
  m.delete
136
+ results = m.details
137
+ results = m.reviews
138
+ results = m.tags
139
+ results = m.activity
136
140
 
137
141
  <Whatser::Poi @lng=4.0, @region="Noord Holland", @gowalla_id="123456", @lat=52.0, @tag_list=nil, @city="Amsterdam", @name="Example Spot", @country="Netherlands", @street="example street", @id=101, @postal_code="1012", @foursquare_id="123456", @created_at="2010-12-24T16:46:23Z">
138
142
 
@@ -265,9 +269,10 @@ A data source represents a free or purchasable content stream of collected spots
265
269
 
266
270
  === Activity Feeds
267
271
 
268
- User activity is recorded by the API, for example when a user adds or tags a POI, befriends another user, or uploads a photo. This activity is recorded in a user's activity feed, a collection of short messages detailing that user's activity. You can view feeds either by user, or globally.
272
+ User activity is recorded by the API, for example when a user adds or tags a POI, befriends another user, or uploads a photo. This activity is recorded in a user's activity feed, a collection of short messages detailing that user's activity. You can view feeds either by user, by spot, or globally.
269
273
 
270
274
  Whatser.client.feed.user( user_id, :page => 1, :per_page => 10 )
275
+ Whatser.client.feed.spot( spot_id, :page => 1, :per_page => 10 )
271
276
  Whatser.client.feed.mine( :page => 1, :per_page => 10 )
272
277
  Whatser.client.feed.global( :page => 1, :per_page => 10 )
273
278
 
@@ -317,7 +322,7 @@ You can use convenience methods on users and spots to determine their connection
317
322
  * API Documentation: http://docs.sogeoapi.com
318
323
  * Facebook: http://www.facebook.com/sogeo
319
324
  * Whatser: http://www.whatser.com
320
- * Twitter: @sogeoapi
325
+ * Twitter: @whatserapi
321
326
 
322
327
  == Copyright
323
328
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -14,7 +14,11 @@ module Whatser
14
14
 
15
15
  def user(user_id, params={})
16
16
  api_request :get, "/api/users/#{user_id}/activity_feed", {:query => params}
17
- end
17
+ end
18
+
19
+ def spot(poi_id, params={})
20
+ api_request :get, "/api/poi/#{poi_id}/activity_feed", {:query => params}
21
+ end
18
22
  end
19
23
  end
20
24
  end
@@ -51,12 +51,16 @@ module Whatser
51
51
  end
52
52
 
53
53
  def reviews(opts={})
54
- Whatser::Review.list(id, opts)
54
+ Whatser::Review.set(self.class.client).list(id, opts)
55
55
  end
56
56
 
57
57
  def details(opts={})
58
- Whatser::Detail.list(id, opts)
59
- end
58
+ Whatser::Detail.set(self.class.client).list(id, opts)
59
+ end
60
+
61
+ def activity(opts)
62
+ Whatser::ActivityFeed.set(self.class.client).spot( self.id, opts )
63
+ end
60
64
 
61
65
  def foursquare_connected?
62
66
  !foursquare_id.blank?
@@ -4,6 +4,7 @@ class TestActivityFeed < Test::Unit::TestCase
4
4
  def setup
5
5
  @client = Whatser::Client.new(:oauth_token => '1234')
6
6
  @user_id = 1
7
+ @spot_id = 101
7
8
  end
8
9
 
9
10
  def test_my_feed
@@ -13,6 +14,10 @@ class TestActivityFeed < Test::Unit::TestCase
13
14
  def test_user_feed
14
15
  assert @client.feeds.user( @user_id, :page => 1, :per_page => 10 ).is_a?(Whatser::Response)
15
16
  end
17
+
18
+ def test_spot_feed
19
+ assert @client.feeds.spot( @spot_id, :page => 1, :per_page => 10 ).is_a?(Whatser::Response)
20
+ end
16
21
 
17
22
  def test_global_feed
18
23
  assert @client.feeds.global( :page => 1, :per_page => 10 ).is_a?(Whatser::Response)
data/test/test_poi.rb CHANGED
@@ -3,7 +3,7 @@ require 'helper'
3
3
  class TestPoi < Test::Unit::TestCase
4
4
  def setup
5
5
  @client = Whatser::Client.new
6
- @poi = Whatser::Poi.new
6
+ @poi = Whatser::Poi.set(@client).new
7
7
  end
8
8
 
9
9
  def test_to_params
@@ -61,15 +61,27 @@ class TestPoi < Test::Unit::TestCase
61
61
  assert_equal hash['country'], poi.country
62
62
  end
63
63
 
64
- def foursquare_connected
64
+ def test_foursquare_connected
65
65
  assert_equal false, @poi.foursquare_connected?
66
66
  @poi.foursquare_id = 1
67
67
  assert_equal true, @poi.foursquare_connected?
68
68
  end
69
69
 
70
- def gowalla_connected
70
+ def test_gowalla_connected
71
71
  assert_equal false, @poi.foursquare_connected?
72
72
  @poi.foursquare_id = 1
73
73
  assert_equal true, @poi.foursquare_connected?
74
74
  end
75
+
76
+ def test_activity
77
+ assert @poi.activity(:opt => 'test').is_a?(Whatser::Response)
78
+ end
79
+
80
+ def test_details
81
+ assert @poi.details(:page => 1).is_a?(Whatser::Response)
82
+ end
83
+
84
+ def test_reviews
85
+ assert @poi.reviews(:page => 1).is_a?(Whatser::Response)
86
+ end
75
87
  end
data/whatser.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{whatser}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
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"]
12
- s.date = %q{2011-01-20}
12
+ s.date = %q{2011-01-28}
13
13
  s.description = %q{The 'Whatser API' Gem is a simple Ruby / Rails wrapper for interacting with Whatser's location-based web services (see http://docs.sogeoapi.com for more details).}
14
14
  s.email = %q{cmd@travisdunn.com}
15
15
  s.extra_rdoc_files = [
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: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Travis Dunn
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-20 00:00:00 +01:00
18
+ date: 2011-01-28 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency