the_pirate_bay 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/the_pirate_bay/torrent/collection.rb +10 -10
- data/lib/the_pirate_bay/version.rb +1 -1
- metadata +2 -2
@@ -21,43 +21,43 @@ module ThePirateBay
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def id
|
24
|
-
@id ||= html.css('td[
|
24
|
+
@id ||= html.css('td')[1].css('div.detName').inner_html.match(/\/torrent\/(\d+)\//)[1]
|
25
25
|
end
|
26
26
|
|
27
27
|
def name
|
28
|
-
@name ||= html.css('td[2]
|
28
|
+
@name ||= html.css('td')[2].css('div.detName a').text
|
29
29
|
end
|
30
30
|
|
31
31
|
def type
|
32
|
-
@type ||= html.css('td
|
32
|
+
@type ||= html.css('td').css('a').map(&:text).join(" > ")
|
33
33
|
end
|
34
34
|
|
35
35
|
def size
|
36
|
-
@size ||= html.css('td[
|
36
|
+
@size ||= html.css('td')[1].css('font.detDesc').text.match(/Size (.*),/)[1].gsub('i', '')
|
37
37
|
end
|
38
38
|
|
39
39
|
def seeders
|
40
|
-
@seeders ||= html.css('td[
|
40
|
+
@seeders ||= html.css('td')[2].text
|
41
41
|
end
|
42
42
|
|
43
43
|
def leechers
|
44
|
-
@leechers ||= html.css('td[
|
44
|
+
@leechers ||= html.css('td')[3].text
|
45
45
|
end
|
46
46
|
|
47
47
|
def magnet_uri
|
48
|
-
@magnet_uri ||= html.css('td[
|
48
|
+
@magnet_uri ||= html.css('td')[1].css('div.detName + a').attribute("href").value
|
49
49
|
end
|
50
50
|
|
51
51
|
def uploaded_at
|
52
|
-
@uploaded_at ||= html.css('td[
|
52
|
+
@uploaded_at ||= html.css('td')[1].css('font.detDesc').text.match(/Uploaded (.*), S/)[1]
|
53
53
|
end
|
54
54
|
|
55
55
|
def uploaded_by
|
56
|
-
@uploaded_by ||= html.css('td[
|
56
|
+
@uploaded_by ||= html.css('td')[1].css('font.detDesc a').text
|
57
57
|
end
|
58
58
|
|
59
59
|
def comments_count
|
60
|
-
@comments_count ||= unless (comments = html.css('td[
|
60
|
+
@comments_count ||= unless (comments = html.css('td')[1].css('img[@src*="comment.gif"]')).empty?
|
61
61
|
comments.attribute("alt").value.match(/\d+/)[0]
|
62
62
|
end
|
63
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: the_pirate_bay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-12-
|
12
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|