the_pirate_bay 0.1.1 → 0.1.2

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.
@@ -21,43 +21,43 @@ module ThePirateBay
21
21
  end
22
22
 
23
23
  def id
24
- @id ||= html.css('td[2] div.detName').inner_html.match(/\/torrent\/(\d+)\//)[1]
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] div.detName a').text
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[1] a').map(&:text).join(" > ")
32
+ @type ||= html.css('td').css('a').map(&:text).join(" > ")
33
33
  end
34
34
 
35
35
  def size
36
- @size ||= html.css('td[2] font.detDesc').text.match(/Size (.*),/)[1].gsub('i', '')
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[3]').text
40
+ @seeders ||= html.css('td')[2].text
41
41
  end
42
42
 
43
43
  def leechers
44
- @leechers ||= html.css('td[4]').text
44
+ @leechers ||= html.css('td')[3].text
45
45
  end
46
46
 
47
47
  def magnet_uri
48
- @magnet_uri ||= html.css('td[2] div.detName + a').attribute("href").value
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[2] font.detDesc').text.match(/Uploaded (.*), S/)[1]
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[2] font.detDesc a').text
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[2] img[@src*="comment.gif"]')).empty?
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
@@ -1,3 +1,3 @@
1
1
  module ThePirateBay
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  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.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-19 00:00:00.000000000 Z
12
+ date: 2013-12-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday