rotoworld 0.3.0 → 0.4.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/lib/CLI.rb +35 -19
- data/lib/Scraper.rb +8 -2
- data/lib/rotoworld/version.rb +1 -1
- data/rotoworld-0.3.0.gem +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62f418df38d10516d60550494e5c808b1c92821d
|
4
|
+
data.tar.gz: 1cdeac179310afa4e7e1981683e6922daeec585a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7890c1b4d66b341829c43717a44916073ca2b97684fcb947575f072c95e23f879ad8db1b79153293e8ac4867eb5de61b4d04ae38bb84460f02e24bd0618b06ce
|
7
|
+
data.tar.gz: fa2b625f272d9e2f9ef56c51d47936eee805285d00da38130d315746249c748c9a7b1883f396473f08a698a58e9b761de3a541f394fe60a2c1c57cad9da3f013
|
data/lib/CLI.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'open-uri'
|
2
|
-
require 'pry'
|
3
2
|
require 'nokogiri'
|
4
3
|
require 'launchy'
|
5
4
|
|
@@ -65,25 +64,42 @@ class Rotoworld::CLI
|
|
65
64
|
puts "Would you like to view the source? (y/n) "
|
66
65
|
input2 = gets.strip
|
67
66
|
if input2.downcase == "yes" || input2.downcase == "y"
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
67
|
+
if post.source != nil
|
68
|
+
Launchy.open(post.source.strip)
|
69
|
+
sleep(5)
|
70
|
+
puts
|
71
|
+
### ESPN Fantasy Football or Draftkings Prompt
|
72
|
+
puts "Would you like to move on or exit? Or type fantasy to make a trade! Or type bet to go to DraftKings!"
|
73
|
+
input3 = gets.strip
|
74
|
+
if input3.downcase == "exit"
|
75
|
+
break
|
76
|
+
elsif input3.downcase == "fantasy"
|
77
|
+
Launchy.open("http://games.espn.go.com/frontpage/football")
|
78
|
+
elsif input3.downcase == "bet"
|
79
|
+
Launchy.open("https://www.draftkings.com/")
|
80
|
+
elsif input3.downcase == "move on"
|
81
|
+
nil
|
82
|
+
elsif input3.downcase == "refresh"
|
83
|
+
call
|
84
|
+
else
|
85
|
+
nil
|
86
|
+
end
|
85
87
|
else
|
86
|
-
|
88
|
+
puts "Source does not exist. Would you like to move on or exit? Or type fantasy to make a trade! Or type bet to go to DraftKings!"
|
89
|
+
input3 = gets.strip
|
90
|
+
if input3.downcase == "exit"
|
91
|
+
break
|
92
|
+
elsif input3.downcase == "fantasy"
|
93
|
+
Launchy.open("http://games.espn.go.com/frontpage/football")
|
94
|
+
elsif input3.downcase == "bet"
|
95
|
+
Launchy.open("https://www.draftkings.com/")
|
96
|
+
elsif input3.downcase == "move on"
|
97
|
+
nil
|
98
|
+
elsif input3.downcase == "refresh"
|
99
|
+
call
|
100
|
+
else
|
101
|
+
nil
|
102
|
+
end
|
87
103
|
end
|
88
104
|
elsif input2.downcase == "refresh"
|
89
105
|
call
|
data/lib/Scraper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'open-uri'
|
2
|
-
|
2
|
+
|
3
3
|
require 'nokogiri'
|
4
4
|
require 'launchy'
|
5
5
|
|
@@ -32,7 +32,13 @@ class Rotoworld::Scraper
|
|
32
32
|
post.title = "#{player_name}#{player_position_team}"
|
33
33
|
post.headline = player.css("div.report p").text
|
34
34
|
post.impact = player.css("div.impact").first.text.strip
|
35
|
-
|
35
|
+
|
36
|
+
if player.css("div.info div.source").text != ""
|
37
|
+
post.source = player.css("div.info div.source a").attr("href").value
|
38
|
+
else
|
39
|
+
post.source = nil
|
40
|
+
end
|
41
|
+
|
36
42
|
post.index = index
|
37
43
|
index +=1
|
38
44
|
|
data/lib/rotoworld/version.rb
CHANGED
data/rotoworld-0.3.0.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rotoworld
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hudbuz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- lib/rotoworld/version.rb
|
108
108
|
- rotoworld-0.1.0.gem
|
109
109
|
- rotoworld-0.2.0.gem
|
110
|
+
- rotoworld-0.3.0.gem
|
110
111
|
- rotoworld.gemspec
|
111
112
|
homepage: https://github.com/hudbuz/rotoworld.git
|
112
113
|
licenses:
|
@@ -128,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
129
|
version: '0'
|
129
130
|
requirements: []
|
130
131
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
132
|
+
rubygems_version: 2.4.8
|
132
133
|
signing_key:
|
133
134
|
specification_version: 4
|
134
135
|
summary: This Gem gives you access to Rotoworld's NFL Player News information news
|