addic7ed 2.1.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/addic7ed +1 -1
- data/lib/addic7ed/parser.rb +8 -8
- data/lib/addic7ed/show_list.rb +1 -1
- data/lib/addic7ed/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fad06add5b388449839b0aa1c9ab5448e51c1d6e
|
4
|
+
data.tar.gz: 7c5694d72836dcca9635aada0dd8d2952a5c269c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ebeb73cdf4d7a191120fcadebdd93615e3491ba2d196c3feb71cbd290f14623867b02a12776515105f2d5dc463db4971aaec5c710b9b7fd8169271688690edf
|
7
|
+
data.tar.gz: 35d93745e43d4f5274bcf5550711774e34eb0950be09cbe271367e8d0a148f0c5b28563837bc0b7950bf58c031e4ff110009d39739cb686919d434f760c0fdf4
|
data/bin/addic7ed
CHANGED
data/lib/addic7ed/parser.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'oga'
|
2
2
|
require 'net/http'
|
3
3
|
require 'open-uri'
|
4
4
|
|
@@ -27,7 +27,7 @@ module Addic7ed
|
|
27
27
|
http.request(request)
|
28
28
|
end
|
29
29
|
raise EpisodeNotFound unless response.body
|
30
|
-
|
30
|
+
Oga.parse_html(response.body)
|
31
31
|
end
|
32
32
|
|
33
33
|
def check_subtitles_presence
|
@@ -58,19 +58,19 @@ module Addic7ed
|
|
58
58
|
def extract_version(sub_node)
|
59
59
|
version_node = sub_node.css('.NewsTitle').first
|
60
60
|
raise Addic7ed::ParsingError unless version_node
|
61
|
-
version_node.
|
61
|
+
version_node.text
|
62
62
|
end
|
63
63
|
|
64
64
|
def extract_language(sub_node)
|
65
65
|
language_node = sub_node.css('.language').first
|
66
66
|
raise Addic7ed::ParsingError unless language_node
|
67
|
-
language_node.
|
67
|
+
language_node.text.gsub(/\A\W*/, '').gsub(/[^\w\)]*\z/, '')
|
68
68
|
end
|
69
69
|
|
70
70
|
def extract_status(sub_node)
|
71
71
|
status_node = sub_node.css('tr:nth-child(3) td:nth-child(4) b').first
|
72
72
|
raise Addic7ed::ParsingError unless status_node
|
73
|
-
status_node.
|
73
|
+
status_node.text.strip
|
74
74
|
end
|
75
75
|
|
76
76
|
def extract_url(sub_node)
|
@@ -85,7 +85,7 @@ module Addic7ed
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def extract_hi(sub_node)
|
88
|
-
hi_node = sub_node.css('tr:nth-child(4) td.newsDate').
|
88
|
+
hi_node = sub_node.css('tr:nth-child(4) td.newsDate img').last
|
89
89
|
raise Addic7ed::ParsingError unless hi_node
|
90
90
|
!hi_node.attribute("title").nil?
|
91
91
|
end
|
@@ -93,13 +93,13 @@ module Addic7ed
|
|
93
93
|
def extract_downloads(sub_node)
|
94
94
|
downloads_node = sub_node.css('tr:nth-child(4) td.newsDate').first
|
95
95
|
raise Addic7ed::ParsingError unless downloads_node
|
96
|
-
/(?<downloads>\d*) Downloads/.match(downloads_node.
|
96
|
+
/(?<downloads>\d*) Downloads/.match(downloads_node.text)[:downloads]
|
97
97
|
end
|
98
98
|
|
99
99
|
def extract_comment(sub_node)
|
100
100
|
comment_node = sub_node.css('tr:nth-child(2) td.newsDate').first
|
101
101
|
raise Addic7ed::ParsingError unless comment_node
|
102
|
-
comment_node.
|
102
|
+
comment_node.text.gsub(/<img[^>]+\>/i, "")
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
data/lib/addic7ed/show_list.rb
CHANGED
@@ -47,7 +47,7 @@ module Addic7ed
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def addic7ed_shows
|
50
|
-
@@addic7ed_shows ||=
|
50
|
+
@@addic7ed_shows ||= Oga.parse_html(addic7ed_homepage.body).css("select#qsShow option:not(:first-child)").map(&:text)
|
51
51
|
end
|
52
52
|
|
53
53
|
def addic7ed_homepage
|
data/lib/addic7ed/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: addic7ed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Baudino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -67,19 +67,19 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: oga
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: '2.7'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: '2.7'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: json
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|