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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/lita/behaviors/lunch_finder.rb +19 -5
- data/lib/lita/handlers/livenation.rb +3 -3
- data/lita-livenation.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 106ef24936066682a319b85d2a8e68f6e52b4ae0
|
4
|
+
data.tar.gz: 7a82b8110418048655a5e9ab09553289dcaf562e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d41709b79051f50f3df76e231222f84226c4f368835386fff09537dd2f5ba06cc5428d37e8af2205513c31b9a35a75a6c25bd817f0738013dd6eb3201cae240
|
7
|
+
data.tar.gz: cd3e39ea1bf81eaf349829d331ebb0d3625f4eeef704207f80023cebb291b795608adcdf2e02b8f43b93e434ab4648a21157bd0edb4a5b76278af149a0d6afcb
|
data/Gemfile.lock
CHANGED
@@ -3,19 +3,33 @@ require 'alchemist'
|
|
3
3
|
|
4
4
|
class LunchFinder
|
5
5
|
|
6
|
-
|
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 =
|
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:
|
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,
|
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
|
-
|
15
|
+
la_or_sf = response.args[1]
|
16
16
|
|
17
|
-
lunch_spots = LunchFinder.search(response.args[0],
|
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
|
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
|
data/lita-livenation.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "lita-livenation"
|
3
|
-
spec.version = "0.0.
|
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.}
|