NBA_info 0.1.7 → 0.1.8
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/NBA_info-0.1.7.gem +0 -0
- data/bin/application.rb +6 -1
- data/lib/NBA_info/NBA_info_ex.rb +4 -5
- data/lib/NBA_info/version.rb +2 -2
- metadata +14 -14
- data/NBA_info-0.1.5.gem +0 -0
- data/NBA_info-0.1.6.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9bd40594650b7eb85e550538f7d95e256eb0f32
|
4
|
+
data.tar.gz: e967429be52c2fd5eaf4442b8d9fcab80dce89a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adec0444f2ac9003af3f0eb0fa864484fccc96dba1f0d65eaadd0bce15cb357f701f6fb0d8436c23e5684c0742421b6696430b84cde8aacee0cd0fd14dee4e52
|
7
|
+
data.tar.gz: f8f83076fa4bfa1e8c4bbaf74989e23d996fe1814fd38fe761bc974ba03d1f3d27dea36229196ce8aadc27697fcae9323f5abb65e8a108d3d4a853c183f34084
|
data/NBA_info-0.1.7.gem
ADDED
Binary file
|
data/bin/application.rb
CHANGED
@@ -15,7 +15,12 @@ if control == 2
|
|
15
15
|
name.downcase!
|
16
16
|
name.gsub!(' ', '_')
|
17
17
|
sean = sam.profile(name)[0]
|
18
|
-
|
18
|
+
if sam.profile(name)[2] == false
|
19
|
+
puts 'Player not found, please input the whole right name.'
|
20
|
+
exit
|
21
|
+
else
|
22
|
+
sean.each { |key, value| puts "#{key} : #{value}" }
|
23
|
+
end
|
19
24
|
elsif control == 1
|
20
25
|
po = sam.game[0]
|
21
26
|
w = sam.game[1]
|
data/lib/NBA_info/NBA_info_ex.rb
CHANGED
@@ -5,6 +5,7 @@ class Scraper
|
|
5
5
|
def game
|
6
6
|
x, y, z, w, team_1, start_line_up, s = [], [], [], [], [], [], []
|
7
7
|
count = 1
|
8
|
+
@execute = true
|
8
9
|
|
9
10
|
doc = Nokogiri.HTML(open('http://scores.espn.go.com/nba/scoreboard'))
|
10
11
|
|
@@ -50,16 +51,14 @@ class Scraper
|
|
50
51
|
web_data_player = 'http://origin.nba.com/playerfile/'
|
51
52
|
web_data_player += name
|
52
53
|
begin
|
53
|
-
open(web_data_player)
|
54
|
+
doc1 = Nokogiri.HTML(open(web_data_player))
|
54
55
|
rescue
|
55
|
-
|
56
|
-
exit
|
56
|
+
@execute = false
|
57
57
|
end
|
58
|
-
doc1 = Nokogiri.HTML(open(web_data_player))
|
59
58
|
profile = doc1.xpath("//div[@class='sponsor-branding']\
|
60
59
|
//tr[@class='stats text-shadow']//td")
|
61
60
|
profile.each { |p| f << p.text }
|
62
61
|
player_profile = Hash[data.zip(f)]
|
63
|
-
[player_profile, f]
|
62
|
+
[player_profile, f, @execute]
|
64
63
|
end
|
65
64
|
end
|
data/lib/NBA_info/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: NBA_info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- poweihuang
|
@@ -16,42 +16,42 @@ dependencies:
|
|
16
16
|
name: minitest
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - '>='
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: minitest-rg
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - '>='
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - '>='
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: nokogiri
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: 1.6.2
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - '>='
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: 1.6.2
|
57
57
|
description: Extract and analyze NBA information from Yahoo sport and ESPN.com
|
@@ -61,12 +61,11 @@ executables:
|
|
61
61
|
extensions: []
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
64
|
-
-
|
64
|
+
- .travis.yml
|
65
65
|
- Gemfile
|
66
66
|
- Gemfile.lock
|
67
67
|
- LICENSE
|
68
|
-
- NBA_info-0.1.
|
69
|
-
- NBA_info-0.1.6.gem
|
68
|
+
- NBA_info-0.1.7.gem
|
70
69
|
- NBA_info.gemspec
|
71
70
|
- README.md
|
72
71
|
- Rakefile
|
@@ -85,18 +84,19 @@ require_paths:
|
|
85
84
|
- lib
|
86
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
87
86
|
requirements:
|
88
|
-
- -
|
87
|
+
- - '>='
|
89
88
|
- !ruby/object:Gem::Version
|
90
89
|
version: '0'
|
91
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
91
|
requirements:
|
93
|
-
- -
|
92
|
+
- - '>='
|
94
93
|
- !ruby/object:Gem::Version
|
95
94
|
version: '0'
|
96
95
|
requirements: []
|
97
96
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.0.14
|
99
98
|
signing_key:
|
100
99
|
specification_version: 4
|
101
100
|
summary: NBA information extractor and analyzer
|
102
|
-
test_files:
|
101
|
+
test_files:
|
102
|
+
- spec/test.rb
|
data/NBA_info-0.1.5.gem
DELETED
Binary file
|
data/NBA_info-0.1.6.gem
DELETED
Binary file
|