counting_stars 0.2.0 → 0.3.0
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.
- checksums.yaml +4 -4
- data/README.md +19 -9
- data/bin/console +0 -0
- data/bin/countingstars +40 -0
- data/counting_stars.gemspec +1 -1
- data/lib/counting_stars/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c81b5efbcb7b6b3bf41c69399b20fb8041b13f59
|
4
|
+
data.tar.gz: 5455a261a590763f2887104763d36001f08f7304
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3fa8627492d34afca23706038a75bb09c7ee8854015c7166060621f1d463839d555a50ee24333db84c2d1695ea02fb1d4526167e5e6c20ac9544bb86aaf4e2d
|
7
|
+
data.tar.gz: 295ea31a498bfddb0fd30a30cd0ce929a39fb35378d0ece3393a93b17f70e98169813c06372af3882938524d7ed607368fa22351a43e615eac309be0d4f363d0
|
data/README.md
CHANGED
@@ -13,7 +13,7 @@ A simple ruby library for extracting rating and metadata information from Google
|
|
13
13
|
|
14
14
|
Add this line to your application's Gemfile:
|
15
15
|
|
16
|
-
```
|
16
|
+
```rb
|
17
17
|
gem 'counting_stars'
|
18
18
|
```
|
19
19
|
|
@@ -32,23 +32,33 @@ Or install it yourself as:
|
|
32
32
|
```rb
|
33
33
|
require 'counting_stars'
|
34
34
|
|
35
|
-
CountingStars::count("Marriott's Grande Ocean", "booking.com")
|
36
|
-
=> ["Rating: 9.4/10", "26 reviews"]
|
37
|
-
|
38
35
|
CountingStars::count("Marriott's Grande Ocean", "tripadvisor.com")
|
39
36
|
=> ["Rating: 4.5", "501 reviews", "Price range: $$$"]
|
40
37
|
|
41
38
|
# Now you can also use shorthand methods
|
42
|
-
CountingStars::booking("
|
43
|
-
=> {:rating=>"9.4", :reviews=>"
|
39
|
+
CountingStars::booking("Kayakapı Premium Caves Cappadocia")
|
40
|
+
=> {:rating=>"9.4", :reviews=>"181"}
|
44
41
|
|
45
|
-
CountingStars::tripadvisor("
|
46
|
-
=> {:rating=>"
|
42
|
+
CountingStars::tripadvisor("Four Seasons Hotel Istanbul Sultanahmet")
|
43
|
+
=> {:rating=>"5", :reviews=>"966", :price_range=>"$$$$"}
|
47
44
|
```
|
48
45
|
|
49
46
|
### Commmandline
|
50
47
|
|
51
|
-
|
48
|
+
```rb
|
49
|
+
Usage
|
50
|
+
countingstars OPTION QUERY
|
51
|
+
|
52
|
+
Options
|
53
|
+
-b, --booking get metadata from booking.com
|
54
|
+
-t, --tripadvisor get metadata from tripadvisor.com
|
55
|
+
-h, --help show this help
|
56
|
+
|
57
|
+
Examples
|
58
|
+
countingstars -t "Gili Lankanfushi Maldives"
|
59
|
+
countingstars -b "The Royal Savoy Sharm El Sheikh"
|
60
|
+
|
61
|
+
```
|
52
62
|
|
53
63
|
## Contributing
|
54
64
|
|
data/bin/console
CHANGED
File without changes
|
data/bin/countingstars
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
|
4
|
+
require 'counting_stars'
|
5
|
+
|
6
|
+
@help = '
|
7
|
+
Usage
|
8
|
+
countingstars OPTION QUERY
|
9
|
+
|
10
|
+
Options
|
11
|
+
-b, --booking get metadata from booking.com
|
12
|
+
-t, --tripadvisor get metadata form tripadvisor.com
|
13
|
+
-h, --help show this help
|
14
|
+
|
15
|
+
Examples
|
16
|
+
countingstars -t "Gili Lankanfushi Maldives"
|
17
|
+
countingstars -b "The Royal Savoy Sharm El Sheikh"
|
18
|
+
'
|
19
|
+
|
20
|
+
def parse_options
|
21
|
+
options = {}
|
22
|
+
case ARGV[0]
|
23
|
+
when '-b', '--booking'
|
24
|
+
options[:b] = ARGV[1]
|
25
|
+
when '-t', '--tripadvisor'
|
26
|
+
options[:t] = ARGV[1]
|
27
|
+
else
|
28
|
+
STDOUT.puts @help
|
29
|
+
end
|
30
|
+
options
|
31
|
+
end
|
32
|
+
|
33
|
+
case ARGV[0]
|
34
|
+
when '-b', '--booking'
|
35
|
+
STDOUT.puts CountingStars::booking parse_options[:b]
|
36
|
+
when '-t', '--tripadvisor'
|
37
|
+
STDOUT.puts CountingStars::tripadvisor parse_options[:t]
|
38
|
+
else
|
39
|
+
STDOUT.puts @help
|
40
|
+
end
|
data/counting_stars.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.bindir = 'bin'
|
19
|
-
spec.executables =
|
19
|
+
spec.executables = ['countingstars']
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
22
|
spec.add_runtime_dependency 'nokogiri', '~> 1.6', '>= 1.6.6.2'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: counting_stars
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kerem Bozdas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -122,7 +122,8 @@ description: A simple tool for extracting rating and metadata information from G
|
|
122
122
|
Search.
|
123
123
|
email:
|
124
124
|
- krmbzds.github@gmail.com
|
125
|
-
executables:
|
125
|
+
executables:
|
126
|
+
- countingstars
|
126
127
|
extensions: []
|
127
128
|
extra_rdoc_files: []
|
128
129
|
files:
|
@@ -136,6 +137,7 @@ files:
|
|
136
137
|
- README.md
|
137
138
|
- Rakefile
|
138
139
|
- bin/console
|
140
|
+
- bin/countingstars
|
139
141
|
- bin/setup
|
140
142
|
- counting_stars.gemspec
|
141
143
|
- lib/counting_stars.rb
|