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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d0e3e9394d3aa42e9595d753a1662c7ec0f7769
4
- data.tar.gz: 32c09023444a609acef3ef10b4b452aeaf5e1b93
3
+ metadata.gz: 62f418df38d10516d60550494e5c808b1c92821d
4
+ data.tar.gz: 1cdeac179310afa4e7e1981683e6922daeec585a
5
5
  SHA512:
6
- metadata.gz: dfadfb443a1cf0df059b53844a4eecefb0de2a8fdfbbdb0a9b9477ed577250f58bf266486444fd5f1291d92a3cfbc9691a8337de9e2e6a3b24a362650a463736
7
- data.tar.gz: 321d5f35e0503b8edc4644948a319cdfc6367b2dac8f2c6a9300d7d6fb08f776d4a8334494c4d3a868f63bd04a94032d5329ddf9a90c58eb2007512f162a6c4a
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
- Launchy.open(post.source.strip)
70
- sleep(5)
71
- puts
72
- ### ESPN Fantasy Football or Draftkings Prompt
73
- puts "Would you like to move on or exit? Or type fantasy to make a trade! Or type bet to go to DraftKings!"
74
- input3 = gets.strip
75
- if input3.downcase == "exit"
76
- break
77
- elsif input3.downcase == "fantasy"
78
- Launchy.open("http://games.espn.go.com/frontpage/football")
79
- elsif input3.downcase == "bet"
80
- Launchy.open("https://www.draftkings.com/")
81
- elsif input3.downcase == "move on"
82
- nil
83
- elsif input3.downcase == "refresh"
84
- call
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
- nil
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
@@ -1,5 +1,5 @@
1
1
  require 'open-uri'
2
- require 'pry'
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
- post.source = player.css("div.info div.source a").attr("href").value
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
 
@@ -1,3 +1,3 @@
1
1
  module Rotoworld
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
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.3.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-03-25 00:00:00.000000000 Z
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.6.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