lita-livenation 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1a6ef43dac4f3caf8f1e5cab61db2bc2b2ebe47
4
- data.tar.gz: 4d9480dd1c70ec9edd44d3364caf3ede497f111d
3
+ metadata.gz: 106ef24936066682a319b85d2a8e68f6e52b4ae0
4
+ data.tar.gz: 7a82b8110418048655a5e9ab09553289dcaf562e
5
5
  SHA512:
6
- metadata.gz: 10d70d9f34809501300a5eeea9c38f4af0842261f006dd25be64b50d6eafe466c3043a10ec18d00127775ae578a5c328a0d8921dd9a797bd16b1ce36c722c101
7
- data.tar.gz: 247defc65dc59bb9cae450b1aec92f0b3f8c27477e8b5e5a32833a6351de6106e42e4877833d2eb64a4258758bd21c09ac39570cda98dc8b2cc648ede7b631f4
6
+ metadata.gz: 3d41709b79051f50f3df76e231222f84226c4f368835386fff09537dd2f5ba06cc5428d37e8af2205513c31b9a35a75a6c25bd817f0738013dd6eb3201cae240
7
+ data.tar.gz: cd3e39ea1bf81eaf349829d331ebb0d3625f4eeef704207f80023cebb291b795608adcdf2e02b8f43b93e434ab4648a21157bd0edb4a5b76278af149a0d6afcb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lita-livenation (0.0.11)
4
+ lita-livenation (0.0.12)
5
5
  alchemist
6
6
  i18n
7
7
  lita (>= 2.7)
@@ -3,19 +3,33 @@ require 'alchemist'
3
3
 
4
4
  class LunchFinder
5
5
 
6
- def initialize(terms, local=true)
6
+
7
+ def initialize(terms, la_or_sf)
8
+ la = [34.101905, -118.344547]
9
+ sf = [37.781528, -122.393169]
10
+
7
11
  @term = terms.join(",")
8
- radius = local ? 1609.34 : 20000
12
+ radius = 2000
13
+
14
+ if la_or_sf == 'sf'
15
+ @latitude = sf[0]
16
+ @longitude = sf[1]
17
+ else
18
+ @latitude = la[0]
19
+ @longitude = la[1]
20
+ end
21
+
9
22
  @search_terms = {
10
23
  term: @term,
11
24
  category_filter: 'restaurants',
25
+ limit: 8,
12
26
  radius_filter: radius
13
27
  }
14
28
  @locale = { lang: 'en' }
15
29
  end
16
30
 
17
31
  def search
18
- coordinates = { latitude: 34.101905, longitude: -118.344547 }
32
+ coordinates = { latitude: @latitude , longitude: @longitude }
19
33
  response = Yelp.client.search_by_coordinates(coordinates, @search_terms, @locale)
20
34
 
21
35
  results = []
@@ -27,11 +41,11 @@ class LunchFinder
27
41
  results
28
42
  end
29
43
 
30
- def self.search(terms, local=false)
44
+ def self.search(terms, la_or_sf="la")
31
45
  if terms.nil? || terms == ''
32
46
  terms = 'food'
33
47
  end
34
48
  terms = terms.split if terms.kind_of? String
35
- new(terms).search
49
+ new(terms, la_or_sf).search
36
50
  end
37
51
  end
@@ -12,11 +12,11 @@ module Lita
12
12
  end
13
13
 
14
14
  def lunch(response)
15
- local = !!(response.args[1] == "local")
15
+ la_or_sf = response.args[1]
16
16
 
17
- lunch_spots = LunchFinder.search(response.args[0], local)
17
+ lunch_spots = LunchFinder.search(response.args[0], la_or_sf)
18
18
  # lunch_spots = ['Shin Ya', "Hoy's Wok", 'Fresh n Easy', 'Baja Fresh', "Zankou's Chicken", 'Mendocino Farms', 'Chipotle', 'Jersey Mike\'s', 'In N Out', 'El Compadre', 'Te\'kila', 'Veggie Grill', '25 Degrees', 'Loteria', 'Subway', 'Buffalo Wild Wings', 'Hooters', 'El Pollo Loco', 'Le Mandarette']
19
- response.reply "Here's a list of #{local ? 'local' : 'non-local'} places to eat."
19
+ response.reply "Here are some places to eat near the #{la_or_sf == 'sf' ? 'San Fran' : 'LA'} office."
20
20
  lunch_spots.each do |spot|
21
21
  response.reply spot
22
22
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-livenation"
3
- spec.version = "0.0.11"
3
+ spec.version = "0.0.12"
4
4
  spec.authors = ["Peter Tran"]
5
5
  spec.email = ["peter@livenationlabs.com"]
6
6
  spec.description = %q{Plugin for Lita that responds to standup with a zoom link.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-livenation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Tran