lakes 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/lakes.gemspec +1 -0
- data/lib/lakes/texas/share_a_lunker.rb +47 -0
- data/lib/lakes.rb +2 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddf60ed7bd6d47a6785409ffc495729b9a1795b1
|
4
|
+
data.tar.gz: 174fa2666b3dd37f5ac1b927be311c98e689c9cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61e19171142cc58750df554a91af85ca5bb19b45f46ab9be2b8168cc77a6f80bc80fbe5b08c1fd0986889426fec039f689e6a4c6b078dab3a56889e4fa4474ad
|
7
|
+
data.tar.gz: 788dfdfd20867ad8db8d413bfb93bfb045e9eaaa28377b3d1a8f8c098546777a4290ff01b0b939ed2ffce7c83cafd64d54568613e6c0ee5b95b4af5b4b021791
|
data/LICENSE.txt
CHANGED
data/lakes.gemspec
CHANGED
@@ -21,5 +21,6 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.15"
|
22
22
|
spec.add_development_dependency "rake", "~> 12.3"
|
23
23
|
spec.add_development_dependency "minitest", "~> 5.11"
|
24
|
+
spec.add_development_dependency "mocha", "~> 1.2"
|
24
25
|
spec.add_dependency 'nokogiri', "~> 1.8"
|
25
26
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
module Lakes
|
3
|
+
class Texas
|
4
|
+
class ShareALunker
|
5
|
+
include Lakes::Helper
|
6
|
+
URL = 'https://tpwd.texas.gov/spdest/visitorcenters/tffc/sharelunker/archives/lunkersearch_adv.phtml'
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@lunker_data = []
|
10
|
+
end
|
11
|
+
|
12
|
+
def list
|
13
|
+
return @lunker_data unless @lunker_data.empty?
|
14
|
+
content = http_get(URL)
|
15
|
+
html_doc = Nokogiri::HTML(content)
|
16
|
+
|
17
|
+
results = []
|
18
|
+
html_doc.search('div#contentwide table tr').each_with_index do |row, index|
|
19
|
+
next if index == 0
|
20
|
+
data = row.search('th, td').to_a
|
21
|
+
|
22
|
+
results << {
|
23
|
+
id: data[0].text.to_i,
|
24
|
+
details_uri: data[0].search('a')[0][:href],
|
25
|
+
date_caught: Date.strptime(cleanup_raw_text(data[1].text), '%m/%d/%Y'),
|
26
|
+
angler: cleanup_raw_text(data[2].text),
|
27
|
+
angler_location: cleanup_raw_text(data[3].text),
|
28
|
+
weight: cleanup_raw_text(data[4].text).to_f,
|
29
|
+
length: cleanup_raw_text(data[5].text).to_f,
|
30
|
+
girth: cleanup_raw_text(data[6].text).to_f,
|
31
|
+
type: cleanup_raw_text(data[7].text),
|
32
|
+
lake: cleanup_raw_text(data[8].text),
|
33
|
+
record: cleanup_raw_text(data[9].text),
|
34
|
+
caught_on: cleanup_raw_text(data[10].text),
|
35
|
+
day_of_week: cleanup_raw_text(data[11].text),
|
36
|
+
moon_phase: cleanup_raw_text(data[12].text),
|
37
|
+
spawned: cleanup_raw_text(data[13].text),
|
38
|
+
returned_to_lake: cleanup_raw_text(data[14].text),
|
39
|
+
status: cleanup_raw_text(data[15].text)
|
40
|
+
}
|
41
|
+
end
|
42
|
+
@lunker_data = results
|
43
|
+
return @lunker_data
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/lakes.rb
CHANGED
@@ -3,6 +3,7 @@ require 'lakes/texas/lake_characteristics_parser'
|
|
3
3
|
require 'lakes/texas/water_conditions_parser'
|
4
4
|
require 'lakes/texas/water_data_parser'
|
5
5
|
require 'lakes/texas/fishing_report_parser'
|
6
|
+
require 'lakes/texas/share_a_lunker'
|
6
7
|
module Lakes
|
7
|
-
VERSION = '0.
|
8
|
+
VERSION = '0.3.0'.freeze
|
8
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lakes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Sherman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '5.11'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mocha
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.2'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: nokogiri
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +102,7 @@ files:
|
|
88
102
|
- lib/lakes/texas.rb
|
89
103
|
- lib/lakes/texas/fishing_report_parser.rb
|
90
104
|
- lib/lakes/texas/lake_characteristics_parser.rb
|
105
|
+
- lib/lakes/texas/share_a_lunker.rb
|
91
106
|
- lib/lakes/texas/water_conditions_parser.rb
|
92
107
|
- lib/lakes/texas/water_data_parser.rb
|
93
108
|
- lib/try.rb
|