piratebay_api 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +11 -11
- data/lib/piratebay_api.rb +4 -3
- data/lib/piratebay_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e88cc90ff0ba7d281a6265ebdcce9d3db993107e
|
4
|
+
data.tar.gz: 405bf3b6dff50f672241c714734d10174c1a16ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52c5e371feeddf85ebaede5519a6cb739aaf15b1a27dee61b77160865dba7242275103868701a6483fc74acbcbddc4fc7f0c4fbf7cc969d0334b80b8c2973036
|
7
|
+
data.tar.gz: cdae071db1552fabcf4451b02403b21ca7c28b2f4c42bc8fc90e4e4f836463f35194805354db7ed3bb2365095c5fec54bc4e74cc0986867d34f55a7335c49abe
|
data/.idea/workspace.xml
CHANGED
@@ -29,11 +29,11 @@
|
|
29
29
|
</component>
|
30
30
|
<component name="FileEditorManager">
|
31
31
|
<leaf>
|
32
|
-
<file leaf-file-name="piratebay_api.rb" pinned="false" current-in-tab="
|
32
|
+
<file leaf-file-name="piratebay_api.rb" pinned="false" current-in-tab="true">
|
33
33
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
|
34
34
|
<provider selected="true" editor-type-id="text-editor">
|
35
|
-
<state vertical-scroll-proportion="0.
|
36
|
-
<caret line="
|
35
|
+
<state vertical-scroll-proportion="0.58093524">
|
36
|
+
<caret line="28" column="12" selection-start-line="28" selection-start-column="12" selection-end-line="28" selection-end-column="12" />
|
37
37
|
<folding />
|
38
38
|
</state>
|
39
39
|
</provider>
|
@@ -79,10 +79,10 @@
|
|
79
79
|
</provider>
|
80
80
|
</entry>
|
81
81
|
</file>
|
82
|
-
<file leaf-file-name="version.rb" pinned="false" current-in-tab="
|
82
|
+
<file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
|
83
83
|
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/version.rb">
|
84
84
|
<provider selected="true" editor-type-id="text-editor">
|
85
|
-
<state vertical-scroll-proportion="0.
|
85
|
+
<state vertical-scroll-proportion="0.0">
|
86
86
|
<caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
87
87
|
<folding />
|
88
88
|
</state>
|
@@ -120,9 +120,9 @@
|
|
120
120
|
<option value="$PROJECT_DIR$/piratebay_api.gemspec" />
|
121
121
|
<option value="$PROJECT_DIR$/lib/piratebay_api/details.rb" />
|
122
122
|
<option value="$PROJECT_DIR$/lib/piratebay_api/result.rb" />
|
123
|
-
<option value="$PROJECT_DIR$/lib/piratebay_api.rb" />
|
124
123
|
<option value="$PROJECT_DIR$/lib/piratebay_api/pirate_bay.rb" />
|
125
124
|
<option value="$PROJECT_DIR$/lib/piratebay_api/version.rb" />
|
125
|
+
<option value="$PROJECT_DIR$/lib/piratebay_api.rb" />
|
126
126
|
</list>
|
127
127
|
</option>
|
128
128
|
</component>
|
@@ -556,18 +556,18 @@
|
|
556
556
|
</state>
|
557
557
|
</provider>
|
558
558
|
</entry>
|
559
|
-
<entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
|
559
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api/version.rb">
|
560
560
|
<provider selected="true" editor-type-id="text-editor">
|
561
561
|
<state vertical-scroll-proportion="0.0">
|
562
|
-
<caret line="
|
562
|
+
<caret line="1" column="18" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
|
563
563
|
<folding />
|
564
564
|
</state>
|
565
565
|
</provider>
|
566
566
|
</entry>
|
567
|
-
<entry file="file://$PROJECT_DIR$/lib/piratebay_api
|
567
|
+
<entry file="file://$PROJECT_DIR$/lib/piratebay_api.rb">
|
568
568
|
<provider selected="true" editor-type-id="text-editor">
|
569
|
-
<state vertical-scroll-proportion="0.
|
570
|
-
<caret line="
|
569
|
+
<state vertical-scroll-proportion="0.58093524">
|
570
|
+
<caret line="28" column="12" selection-start-line="28" selection-start-column="12" selection-end-line="28" selection-end-column="12" />
|
571
571
|
<folding />
|
572
572
|
</state>
|
573
573
|
</provider>
|
data/lib/piratebay_api.rb
CHANGED
@@ -17,10 +17,11 @@ end
|
|
17
17
|
class PiratebayApi
|
18
18
|
attr_accessor :service, :search_term, :results
|
19
19
|
|
20
|
-
def initialize(service=:pirate_bay, search_term=nil, url)
|
20
|
+
def initialize(service=:pirate_bay, search_term=nil, url, category=0)
|
21
21
|
@service = service
|
22
22
|
@search_term = search_term
|
23
23
|
@base_url = url
|
24
|
+
@category = category
|
24
25
|
|
25
26
|
@results = search if @search_term
|
26
27
|
end
|
@@ -28,12 +29,12 @@ class PiratebayApi
|
|
28
29
|
def search
|
29
30
|
if @service == :all
|
30
31
|
results = []
|
31
|
-
results << PirateBay::Search.new(@search_term,
|
32
|
+
results << PirateBay::Search.new(@search_term, @category, @base_url).execute
|
32
33
|
results = results.flatten.sort_by { |sort| -(sort.seeds) }
|
33
34
|
else
|
34
35
|
case @service
|
35
36
|
when :pirate_bay
|
36
|
-
handler = PirateBay::Search.new(@search_term,
|
37
|
+
handler = PirateBay::Search.new(@search_term, @category, @base_url)
|
37
38
|
else
|
38
39
|
raise 'You must select a valid service provider'
|
39
40
|
end
|