yelpme 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.md +37 -0
- data/Rakefile +1 -0
- data/bin/yelpme +4 -0
- data/lib/yelpme/version.rb +3 -0
- data/lib/yelpme.rb +29 -0
- data/yelpme.gemspec +20 -0
- metadata +75 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
#Yelpme so I don't have to.
|
2
|
+
|
3
|
+
##WHOOPS
|
4
|
+
So this gem is a work in progress, clearly. That being said, the maintainer of the yelp2 gem has not
|
5
|
+
released to rubygems.org and so my require statement is basically going to fail for you.
|
6
|
+
|
7
|
+
So if you're really anxious and dont want to wait for him, clone the yelp2 repo and run `rake install` and:
|
8
|
+
:star: :star: star: You'll be good to go. :star: :star: :star:
|
9
|
+
|
10
|
+
##What
|
11
|
+
Yelpme uses the [yelp2](https://github.com/rdeshpande/yelp2) Ruby wrapper by [rdeshpande](https://github.com/rdeshpande)
|
12
|
+
to be used on the command line.
|
13
|
+
|
14
|
+
##Why
|
15
|
+
I'm lazy and often can't decide what to eat for lunch, dinner, breakfast,
|
16
|
+
bars, etc. Or I don't know what kind of pizza I want, but I know where.
|
17
|
+
|
18
|
+
Yes, I know I know.. I could go to Yelp's site and type this in, but
|
19
|
+
fuck that. As I said I'm lazy.
|
20
|
+
|
21
|
+
##How
|
22
|
+
$ yelpme breakfast "san francisco"
|
23
|
+
#=> etc etc
|
24
|
+
$ yelpme plow "potrero hill"
|
25
|
+
#=> all info for Plow
|
26
|
+
|
27
|
+
Works just like you would expect from the web interface!
|
28
|
+
|
29
|
+
##Who
|
30
|
+
You, and me baby.
|
31
|
+
|
32
|
+
I'd love pull requests, issues filed for new feature request, moar tests,
|
33
|
+
etc!
|
34
|
+
|
35
|
+
|
36
|
+
##Me :heart:
|
37
|
+
I'm [brntbeer](https://github.com/brntbeer) and I approve this message
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/bin/yelpme
ADDED
data/lib/yelpme.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require "yelpme/version"
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'rubygems'
|
5
|
+
rescue LoadError
|
6
|
+
end
|
7
|
+
require "yelp2"
|
8
|
+
|
9
|
+
|
10
|
+
module Yelpme
|
11
|
+
|
12
|
+
# A quick search to get the first result
|
13
|
+
#
|
14
|
+
# args - the list of arguments you may pass in to search on yelp
|
15
|
+
#
|
16
|
+
# Examples
|
17
|
+
#
|
18
|
+
# search("breakfast", "san francisco")
|
19
|
+
# # => 'Plow'
|
20
|
+
#
|
21
|
+
# Returns the first result based on the arguments.
|
22
|
+
def self.search(*args)
|
23
|
+
term = args.shift
|
24
|
+
location = {}
|
25
|
+
location[:location] = args.shift
|
26
|
+
query = Yelp::Base.new(ENV["YELP_CONSUMER_KEY"],ENV["YELP_CONSUMER_SECRET"],ENV["YELP_TOKEN"], ENV["YELP_TOKEN_SECRET"])
|
27
|
+
puts query.search(term, location)[0].inspect
|
28
|
+
end
|
29
|
+
end
|
data/yelpme.gemspec
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "yelpme/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "yelpme"
|
7
|
+
s.version = Yelpme::VERSION
|
8
|
+
s.authors = ["brntbeer"]
|
9
|
+
s.email = ["brent.beer@gmail.com"]
|
10
|
+
s.homepage = "http://rubygems.org/gems/yelpme"
|
11
|
+
s.summary = %q{Yelpme is an interface to using Yelp's API.}
|
12
|
+
s.description = %q{Yelpme is used to utilize Yelp's API from the command line using the already existing yelp2 gem.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "yelpme"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: yelpme
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- brntbeer
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-09-13 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description: Yelpme is used to utilize Yelp's API from the command line using the already existing yelp2 gem.
|
23
|
+
email:
|
24
|
+
- brent.beer@gmail.com
|
25
|
+
executables:
|
26
|
+
- yelpme
|
27
|
+
extensions: []
|
28
|
+
|
29
|
+
extra_rdoc_files: []
|
30
|
+
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- Gemfile
|
34
|
+
- README.md
|
35
|
+
- Rakefile
|
36
|
+
- bin/yelpme
|
37
|
+
- lib/yelpme.rb
|
38
|
+
- lib/yelpme/version.rb
|
39
|
+
- yelpme.gemspec
|
40
|
+
has_rdoc: true
|
41
|
+
homepage: http://rubygems.org/gems/yelpme
|
42
|
+
licenses: []
|
43
|
+
|
44
|
+
post_install_message:
|
45
|
+
rdoc_options: []
|
46
|
+
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
hash: 3
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
version: "0"
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 3
|
64
|
+
segments:
|
65
|
+
- 0
|
66
|
+
version: "0"
|
67
|
+
requirements: []
|
68
|
+
|
69
|
+
rubyforge_project: yelpme
|
70
|
+
rubygems_version: 1.6.2
|
71
|
+
signing_key:
|
72
|
+
specification_version: 3
|
73
|
+
summary: Yelpme is an interface to using Yelp's API.
|
74
|
+
test_files: []
|
75
|
+
|