vegas_insider_scraper 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sports/scraper_league.rb +14 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 078b7e0983c9f1b83cd879d2e272ffa82c428745
|
4
|
+
data.tar.gz: 81b32f713782cf8c311c0fbb4c8d6424c4f77e40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a009067788bec8673d29566a17d9a9cc13bacca4ad2be338269d962b1512a2dc74140c9054d510cf8be571584ff8ad28350a51ce488090eaaa8359a6d790ae43
|
7
|
+
data.tar.gz: 855206426a8e92f1f76e9c1f91933601dd90c04c151d801327ec6ad74df211d54c27c529d245c77d730a7e4a7ab570926fe47a7d30cd4a815da04c84ecf3d2c9
|
@@ -218,7 +218,7 @@ class ScraperLeague
|
|
218
218
|
# * formats the team using the URL and the Nokogiri document for the teams page
|
219
219
|
def format_college_team(url, teams_doc)
|
220
220
|
full_name = team_page_full_name(teams_doc, url)
|
221
|
-
location = url.content
|
221
|
+
location = url.content.gsub('AM', 'A&M').gsub('AT', 'A&T')
|
222
222
|
identifier = team_url_parser(url.attribute('href'))
|
223
223
|
nickname = full_name.gsub("#{location} ",'')
|
224
224
|
|
@@ -229,6 +229,10 @@ class ScraperLeague
|
|
229
229
|
if nickname == full_name.gsub('&','').strip
|
230
230
|
nickname_array = nickname.split(' ')
|
231
231
|
nickname = nickname_array.each_slice( (nickname_array.size/2.0).round ).to_a[1].join(' ')
|
232
|
+
nickname = nickname_exceptions(identifier,nickname)
|
233
|
+
puts identifier
|
234
|
+
puts nickname
|
235
|
+
puts "****************************"
|
232
236
|
end
|
233
237
|
|
234
238
|
return {
|
@@ -244,6 +248,15 @@ class ScraperLeague
|
|
244
248
|
identifier.split('-').map { |x| x.capitalize }.join(' ')
|
245
249
|
end
|
246
250
|
|
251
|
+
def nickname_exceptions(identifier,nickname)
|
252
|
+
case identifier
|
253
|
+
when 'california-state-long-beach' then '49ers'
|
254
|
+
when 'texas-am-corpus-christi' then 'Islanders'
|
255
|
+
when 'southern-am' then 'Jaguars'
|
256
|
+
when 'saint-marys-college-california' then 'Gaels'
|
257
|
+
else nickname end
|
258
|
+
end
|
259
|
+
|
247
260
|
# Utility method for scraping standings
|
248
261
|
# * gets the full team name using the teams page
|
249
262
|
def team_page_full_name(doc,url)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vegas_insider_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Reitz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|