sjunkieex 0.0.1
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.
- data/.gitignore +19 -0
- data/Gemfile +7 -0
- data/LICENSE +18 -0
- data/README.md +22 -0
- data/Rakefile +9 -0
- data/bin/sjunkieex +122 -0
- data/lib/sjunkieex/interface.rb +147 -0
- data/lib/sjunkieex/series_index.rb +134 -0
- data/lib/sjunkieex/version.rb +3 -0
- data/lib/sjunkieex.rb +7 -0
- data/sjunkieex.gemspec +20 -0
- data/test/seriesindex_example.xml +4568 -0
- data/test/site_dumps/chase.html +757 -0
- data/test/site_dumps/homepage.html +3345 -0
- data/test/test_helper.rb +8 -0
- data/test/test_interface.rb +53 -0
- data/test/test_series_index.rb +69 -0
- metadata +101 -0
data/test/test_helper.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
3
|
+
|
4
|
+
class TestInterface < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
files = [ File.dirname(__FILE__) + '/seriesindex_example.xml' ]
|
8
|
+
|
9
|
+
@series_index = Sjunkieex::SeriesIndex.new(files: files)
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_instantiating
|
13
|
+
interface = Sjunkieex::Interface.new(@series_index)
|
14
|
+
assert_instance_of Sjunkieex::Interface, interface
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_option_passing
|
18
|
+
url = "http://example.org"
|
19
|
+
interface = Sjunkieex::Interface.new(@series_index, url: url)
|
20
|
+
assert_equal interface.options[:url], url
|
21
|
+
|
22
|
+
interface = Sjunkieex::Interface.new(@series_index)
|
23
|
+
assert_equal interface.options[:url], "http://serienjunkies.org"
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_parse_homepage
|
27
|
+
filename = File.dirname(__FILE__) + '/site_dumps/homepage.html'
|
28
|
+
interface = Sjunkieex::Interface.new(@series_index, url: filename)
|
29
|
+
|
30
|
+
links = interface.look_for_new_episodes
|
31
|
+
|
32
|
+
assert_equal false, links.empty?
|
33
|
+
|
34
|
+
assert_equal true, links.include?("http://serienjunkies.org/serie/chase-2010/")
|
35
|
+
assert_equal "Chase", links["http://serienjunkies.org/serie/chase-2010/"]
|
36
|
+
|
37
|
+
assert_equal true, links.include?("http://serienjunkies.org/serie/shameless-us/")
|
38
|
+
assert_equal "Shameless US", links["http://serienjunkies.org/serie/shameless-us/"]
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_parse_series_page
|
42
|
+
interface = Sjunkieex::Interface.new(@series_index)
|
43
|
+
filename = File.dirname(__FILE__) + '/site_dumps/chase.html'
|
44
|
+
|
45
|
+
link_data = interface.parse_series_page("Chase", filename)
|
46
|
+
assert_instance_of Hash, link_data
|
47
|
+
|
48
|
+
assert_equal 2, link_data.length
|
49
|
+
|
50
|
+
assert_equal true, link_data["1_14"][:sd].include?(
|
51
|
+
"http://download.serienjunkies.org/f-ddc2985db78e3e7d/nl_tvp-chase-xv-114.html")
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
3
|
+
|
4
|
+
class TestInterface < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
files = [ File.dirname(__FILE__) + '/seriesindex_example.xml' ]
|
8
|
+
|
9
|
+
@series_index = Sjunkieex::SeriesIndex.new(files: files)
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_instantiating
|
13
|
+
index = Sjunkieex::SeriesIndex.new()
|
14
|
+
assert_instance_of Sjunkieex::SeriesIndex, index
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_parse_seriesindex
|
18
|
+
assert_equal 13, @series_index.series_data["Chase"].length
|
19
|
+
|
20
|
+
assert_equal "S01E04 - Blutiger Wahnsinn.avi",
|
21
|
+
@series_index.series_data["Chase"]["1_4"]
|
22
|
+
|
23
|
+
assert_equal false, @series_index.empty?
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_check_for_episode_existance
|
27
|
+
assert_equal true, @series_index.episode_existing?("Chase",
|
28
|
+
"Chase.S01E04.Episodename.avi")
|
29
|
+
|
30
|
+
assert_equal false, @series_index.episode_existing?("Chase",
|
31
|
+
"Chase.S03E04.Episodename.avi")
|
32
|
+
|
33
|
+
assert_equal true, @series_index.episode_existing?("Miami Medical",
|
34
|
+
"Miami.Medical.S01E04.Episodename.avi")
|
35
|
+
|
36
|
+
assert_equal false, @series_index.episode_existing?("Not Exisiting",
|
37
|
+
"Not.Existing.S03E04.Episodename.avi")
|
38
|
+
|
39
|
+
assert_equal false, @series_index.episode_existing?("Chase",
|
40
|
+
"Chase.S01E14.Rache.an.Annie.Teil.3.GERMAN.DUBBED.DL.720p.HDTV.x264-TVP")
|
41
|
+
|
42
|
+
assert_equal true, @series_index.episode_existing?("Shameless US",
|
43
|
+
"Shameless.US.S02E11.Just.Like.The.Pilgrims.Intended.German.Dubbed.DL.VoDHD.XviD-TVS")
|
44
|
+
|
45
|
+
assert_equal true, @series_index.episode_existing?("The Listener",
|
46
|
+
"The.Listener.S03E01.Bankgeheimnis.DL.German.HDTV.XviD-GDR")
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_check_seriesname_in_index
|
50
|
+
assert_equal true, @series_index.is_series_in_index?(
|
51
|
+
"Chase.S01E13.Rache.an.Annie.Teil.2.GERMAN.DUBBED.WS.HDTVRip.XviD-TVP")
|
52
|
+
|
53
|
+
assert_equal true, @series_index.is_series_in_index?(
|
54
|
+
"Unforgettable.S01E08.All.unsere.Sachen.German.DL.Dubbed.WS.WEB-DL.XviD.REPACK-GDR")
|
55
|
+
|
56
|
+
assert_equal true, @series_index.is_series_in_index?(
|
57
|
+
"Life.Unexpected.S02E10.Spiel.mit.dem.Feuer.German.Dubbed.DL.720p.WEB-DL.h264-GDR")
|
58
|
+
|
59
|
+
assert_equal false, @series_index.is_series_in_index?(
|
60
|
+
"Ugly.Betty.S03E10.Boese.Amanda.German.DL.Dubbed.WEBRiP.XViD-GDR")
|
61
|
+
|
62
|
+
assert_equal false, @series_index.is_series_in_index?(
|
63
|
+
"Memphis.Beat.S01E06.Sein.letzter.Kampf.GERMAN.DUBBED.720p.HDTV.x264-ZZGtv")
|
64
|
+
|
65
|
+
assert_equal false, @series_index.is_series_in_index?(
|
66
|
+
"Private.Practice.S05E12.Aussichtsloser.Kampf.German.Dubbed.WS.WEB-DL.XviD-GDR")
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sjunkieex
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Philipp Böhm
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-30 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nokogiri
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.5'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.5'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: hashconfig
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.0.1
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.0.1
|
46
|
+
description: Tool that extracts links from serienjunkies.org
|
47
|
+
email:
|
48
|
+
- philipp@i77i.de
|
49
|
+
executables:
|
50
|
+
- sjunkieex
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- .gitignore
|
55
|
+
- Gemfile
|
56
|
+
- LICENSE
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- bin/sjunkieex
|
60
|
+
- lib/sjunkieex.rb
|
61
|
+
- lib/sjunkieex/interface.rb
|
62
|
+
- lib/sjunkieex/series_index.rb
|
63
|
+
- lib/sjunkieex/version.rb
|
64
|
+
- sjunkieex.gemspec
|
65
|
+
- test/seriesindex_example.xml
|
66
|
+
- test/site_dumps/chase.html
|
67
|
+
- test/site_dumps/homepage.html
|
68
|
+
- test/test_helper.rb
|
69
|
+
- test/test_interface.rb
|
70
|
+
- test/test_series_index.rb
|
71
|
+
homepage: ''
|
72
|
+
licenses: []
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 1.8.24
|
92
|
+
signing_key:
|
93
|
+
specification_version: 3
|
94
|
+
summary: serienjunkies.org link extractor
|
95
|
+
test_files:
|
96
|
+
- test/seriesindex_example.xml
|
97
|
+
- test/site_dumps/chase.html
|
98
|
+
- test/site_dumps/homepage.html
|
99
|
+
- test/test_helper.rb
|
100
|
+
- test/test_interface.rb
|
101
|
+
- test/test_series_index.rb
|