skittles 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -81,6 +81,15 @@ module Skittles
81
81
  def friends(id, options = {})
82
82
  get("users/#{id}/friends").friends
83
83
  end
84
+ # Returns the user's leaderboard.
85
+ #
86
+ # @param neightbors [Integer] Number of friends' scores to return that are adjacent to your score in ranked order. The current user's score is returned as well.
87
+ # @return [Hashie::Mash] A count and items containing compact user objects, their respective scores, and their integer rank value relative to the current user.
88
+ # @requires_acting_user Yes
89
+ # @see https://developer.foursquare.com/docs/users/leaderboard.html
90
+ def leaderboard(neighbors = nil)
91
+ get('users/leaderboard').leaderboard
92
+ end
84
93
 
85
94
  # Changes whether the acting user will receive pings (phone
86
95
  # notifications) when the specified user checks in.
@@ -47,6 +47,26 @@ module Skittles
47
47
  get('venues/categories').categories
48
48
  end
49
49
 
50
+ # Returns a list of recommended venues near the current location.
51
+ #
52
+ # @note This is an experimental API.
53
+ # @param ll [String] Latitude and longitude of the user's location.
54
+ # @param options [Hash] A customizable set of options.
55
+ # @option options [Decimal] llAcc Accuracy of latitude and longitude, in meters.
56
+ # @option options [Decimal] alt Altitude of the user's location, in meters.
57
+ # @option options [Decimal] altAcc Accuracy of the user's altitude, in meters.
58
+ # @option radius [Integer] Radius to search within, in meters.
59
+ # @option section [String] One of food, drinks, coffee, shops, or arts. Limits results to venues with categories matching these terms.
60
+ # @option query [String] A search term to be applies against tips, category tips, etc. at a venue.
61
+ # @option limit [Integer] Number of results to return, up to 50.
62
+ # @option basis [String] If present and set to friends or me, limits results to only places where friends have visited or user has visited, respectively.
63
+ # @return [Hashie::Mash] Response fields keywords, warnings and groups.
64
+ # @requires_acting_user No
65
+ # @see https://developer.foursquare.com/docs/venues/explore.html
66
+ def explore(ll, options = {})
67
+ get('venues/explore', { :ll => ll }.merge(options)).groups
68
+ end
69
+
50
70
  # Allows a user to indicated a venue is incorrect in some way.
51
71
  #
52
72
  # @param id [String] The venue id for which an edit is being proposed.
@@ -148,6 +168,18 @@ module Skittles
148
168
  get("venues/#{id}").venue
149
169
  end
150
170
 
171
+ # Returns URLs or identifier from third parties that have been applied to this
172
+ # venue.
173
+ #
174
+ # @note This is an experimental API.
175
+ # @param id [String] The venue you want annotations for.
176
+ # @return [Hashie::Mash] A count and items of links.
177
+ # @requires_acting_user No
178
+ # @see https://developer.foursquare.com/docs/venues/links.html
179
+ def venue_links(id)
180
+ get("venues/#{id}/links").links
181
+ end
182
+
151
183
  # Allows a user to mark a venue to-do, with optional text.
152
184
  #
153
185
  # @param id The venue you want to mark to-do.
@@ -175,6 +207,10 @@ module Skittles
175
207
  # @option options [String] query A search term to be applied against titles.
176
208
  # @option options [Integer] limit Number of results to return, up to 50.
177
209
  # @option options [String] intent Indicates your intent in performing the search.
210
+ # @option options [String] categoryId A category to limit the results to. (experimental)
211
+ # @option options [String] url A third-party URL which is attempted to match against a map of venues to URLs. (experimental)
212
+ # @option options [String] providerId Identifier for a known third party that is part of a map of venues to URLs, used in conjunction with linkedId. (experimental)
213
+ # @option options [Integer] linkedId Identifier used by third party specified in providerId, which will be attempted to match against a map of venues to URLs. (experimental)
178
214
  # @return [Hashie::Mash] An array of objects representing groups of venues.
179
215
  # @requires_acting_user No
180
216
  # @see http://developer.foursquare.com/docs/venues/search.html
@@ -36,6 +36,10 @@ module Skittles
36
36
  :client_secret => client_secret
37
37
  })
38
38
 
39
+ options.merge!({
40
+ :v => Time.now.strftime('%Y%m%d')
41
+ })
42
+
39
43
  begin
40
44
  response = connection.request(method, paramify(path, options), headers)
41
45
  rescue OAuth2::ErrorWithResponse => e
@@ -1,3 +1,3 @@
1
1
  module Skittles
2
- VERSION = '0.3.1'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: skittles
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.1
5
+ version: 0.4.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Anthony Smith
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-12 00:00:00 -05:00
13
+ date: 2011-06-23 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 0.1.1
23
+ version: 0.4.1
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: *id001
@@ -64,7 +64,7 @@ dependencies:
64
64
  requirements:
65
65
  - - ~>
66
66
  - !ruby/object:Gem::Version
67
- version: 1.0.10
67
+ version: 1.0.15
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: *id005
@@ -75,7 +75,7 @@ dependencies:
75
75
  requirements:
76
76
  - - ~>
77
77
  - !ruby/object:Gem::Version
78
- version: 1.5.2
78
+ version: 1.6.2
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: *id006
@@ -97,7 +97,7 @@ dependencies:
97
97
  requirements:
98
98
  - - ~>
99
99
  - !ruby/object:Gem::Version
100
- version: 0.6.4
100
+ version: 0.7.2
101
101
  type: :development
102
102
  prerelease: false
103
103
  version_requirements: *id008
@@ -129,8 +129,6 @@ files:
129
129
  - lib/skittles/version.rb
130
130
  - LICENSE.txt
131
131
  - README.rdoc
132
- - spec/skittles_spec.rb
133
- - spec/spec_helper.rb
134
132
  has_rdoc: true
135
133
  homepage: http://github.com/anthonator/skittles
136
134
  licenses:
@@ -145,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
143
  requirements:
146
144
  - - ">="
147
145
  - !ruby/object:Gem::Version
148
- hash: 4092488723339903251
146
+ hash: -3536193774362662556
149
147
  segments:
150
148
  - 0
151
149
  version: "0"
@@ -162,6 +160,5 @@ rubygems_version: 1.6.2
162
160
  signing_key:
163
161
  specification_version: 3
164
162
  summary: Foursquare v2 REST API client library for Ruby
165
- test_files:
166
- - spec/skittles_spec.rb
167
- - spec/spec_helper.rb
163
+ test_files: []
164
+
@@ -1,7 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "Skittles" do
4
- it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
6
- end
7
- end
@@ -1,12 +0,0 @@
1
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
- $LOAD_PATH.unshift(File.dirname(__FILE__))
3
- require 'rspec'
4
- require 'skittles'
5
-
6
- # Requires supporting files with custom matchers and macros, etc,
7
- # in ./support/ and its subdirectories.
8
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
-
10
- RSpec.configure do |config|
11
-
12
- end