NBA_info 0.1.3 → 0.1.5
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/.travis.yml +5 -5
- data/NBA_info-0.1.4.gem +0 -0
- data/README.md +12 -5
- data/lib/NBA_info/NBA_info_ex.rb +3 -3
- data/lib/NBA_info/version.rb +1 -1
- metadata +5 -4
- data/NBA_info-0.1.2.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: 36864b1d2ad1d4ba42644b35c16ff021eb3446e9
|
4
|
+
data.tar.gz: d0a761f7c13d5fe992c8241d8f6d5a427eca920b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87419857ad3a6238c3d50a29c46fcc0ca4b3ea13fa7ca936ca82269c33e24b1ebaf6401521f663c36dbda9d9c9c25c3e491324b2fafe26332679e4c5a5c76a03
|
7
|
+
data.tar.gz: 627a738e66fb398417ee3b186c6782482dfe9bbef13d55389db76be0100a34fa6abc6fb3d01cc99d7a0c53d36a6bf407447dc58da2a5f4bcf7d38e4e7784434c
|
data/.travis.yml
CHANGED
data/NBA_info-0.1.4.gem
ADDED
Binary file
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
#WebScraper HW
|
2
|
-
>
|
3
|
-
To run this project, you should execute the file from the following path '/lib/application.rb' with Ruby.
|
1
|
+
#WebScraper HW - NBA_info
|
2
|
+
>This assignment scrapes the information and parse HTML directly from websites. It can help you to collect the imformation of NBA's games and players.
|
4
3
|
##Choice of website
|
5
4
|
</br>
|
6
5
|
First, we choose the NBA sports infomation on <http://scores.espn.go.com/nba/scoreboard> and scrape each game's starting lineup.
|
6
|
+
<br />
|
7
7
|
Second, we use the NBA players website <http://origin.nba.com/players/> to scrape the players' current season stats which user enters.
|
8
8
|
##Structure of our Code
|
9
9
|
</br>
|
@@ -11,10 +11,17 @@ We used `Nokogiri` to parse HTML on Ruby, then used `XPATH` to find the tag on H
|
|
11
11
|
|
12
12
|
require 'open-uri'
|
13
13
|
require 'nokogiri'
|
14
|
-
|
14
|
+
|
15
|
+
##Usage
|
15
16
|
</br>
|
16
|
-
|
17
|
+
To run this project, you should install the gem by the following command. Then you can require the library in ruby.
|
18
|
+
|
19
|
+
gem install NBA_info
|
20
|
+
|
21
|
+
Users can enter '1' to see the starting lineup in today's game or see the highest records(PTS, REB, STL) in the final game.<br />
|
22
|
+
Users can also enter '2' to see any players' stats in current season they enter.
|
17
23
|
##Collaborator
|
24
|
+
</br>
|
18
25
|
* [seanyen0507](https://github.com/seanyen0507)
|
19
26
|
* [hsuchinwang](https://github.com/hsuchinwang)
|
20
27
|
* [poweihuang](https://github.com/poweihuang)
|
data/lib/NBA_info/NBA_info_ex.rb
CHANGED
@@ -26,15 +26,15 @@ class Scraper
|
|
26
26
|
//table[@class='game-stat-overview']//tbody//tr//td")
|
27
27
|
player.each { |p| start_line_up << p.text }
|
28
28
|
|
29
|
-
(y.size / 2
|
29
|
+
(y.size / 2).times do |i|
|
30
30
|
z << y[i * 2] + ' v.s ' + y[i * 2 + 1]
|
31
31
|
end
|
32
32
|
|
33
|
-
(team_1.size / 2
|
33
|
+
(team_1.size / 2).times do |i|
|
34
34
|
w << team_1[i * 2] + ' v.s ' + team_1[i * 2 + 1]
|
35
35
|
end
|
36
36
|
|
37
|
-
(start_line_up.size / 5
|
37
|
+
(start_line_up.size / 5).times do |i|
|
38
38
|
s << start_line_up[i * 5] + "\t" + "#{start_line_up[i * 5 + 1]} "\
|
39
39
|
"#{start_line_up[i * 5 + 2]}" + ' v.s ' + "#{start_line_up[i * 5 + 3]} "\
|
40
40
|
"#{start_line_up[i * 5 + 4]}"
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- poweihuang
|
@@ -51,7 +51,7 @@ files:
|
|
51
51
|
- Gemfile
|
52
52
|
- Gemfile.lock
|
53
53
|
- LICENSE
|
54
|
-
- NBA_info-0.1.
|
54
|
+
- NBA_info-0.1.4.gem
|
55
55
|
- NBA_info.gemspec
|
56
56
|
- README.md
|
57
57
|
- Rakefile
|
@@ -80,8 +80,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.4.1
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: NBA information extractor and analyzer
|
87
|
-
test_files:
|
87
|
+
test_files:
|
88
|
+
- spec/test.rb
|
data/NBA_info-0.1.2.gem
DELETED
Binary file
|