nnmClub_api 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bbb50fc2b0ad999c914a706c40c85ddc9a26ccb
4
- data.tar.gz: 31a2c9a906ffe9867654a8768bfca844f0165d57
3
+ metadata.gz: 2d5291177417e6d6c8309cec9361928d80d4a1d0
4
+ data.tar.gz: 63d3199fbb56fa31c7ad68ea9ca509f521cd9a65
5
5
  SHA512:
6
- metadata.gz: 8f0bbdee7d092bc664b5ab298b88354d1925444a3c460a31f900261da17654ae7466c8793c10bc66091edeb9f9fe681c143d2dbd3db2b0cba16cdb661540b1db
7
- data.tar.gz: 960f2f698b7eb177eef51faf97508409df7e8bf6dd9f29c3f25238c188b1c1b5ed5d2025c251c5099a288b2beff97564bc83f30e7557c91b25afd5eb55c6dcf7
6
+ metadata.gz: 5f768885731a6ef23c377be576a9bab3ac1e10ebfe043cf91ab78d4004842c947b73e3ef66fd652b2edab47b71ad857db90bc351cc98aa34c062befe9d4a59e1
7
+ data.tar.gz: 3100f8621e66abc43d7739cd98256be262d2fb4d42da6e1e086291647c4db3143c30bfc2b3fdc1da48d233707bb44da311d4203606450c3244fcc8483d34a580
@@ -1,14 +1,15 @@
1
1
  module NnmClub
2
2
  class Torrent
3
3
  def self.find(torrent_id, agent = Mechanize.new)
4
- document = agent.get(NnmClub::TorrentURL+torrent_id)
4
+ torrent_url = NnmClub::TorrentURL+torrent_id
5
+ document = agent.get(torrent_url)
5
6
  content_xpath = "/html/body/div[@class='wrap']/table//tr[2]/td/table//tr/td/table[@class='forumline']//tr[@class='row1']/td[@class='row1'][2]/table//tr[3]/td"
6
7
  link_xpath = "/html/body/div[2]/table//tr[2]/td/table//tr/td/table[5]//tr[2]/td[2]/table//tr[4]/td/table[2]//tr[2]/td[3]/a"
7
8
  content = document.search(content_xpath)
8
9
  content.search(".//img",".//a").remove
9
10
  return {
10
11
  :content => content.to_html(encoding: "UTF-8"),
11
- :magnet => document.search(link_xpath).empty? ? "none" : document.search(link_xpath).first[:href],
12
+ :magnet => document.search(link_xpath).empty? ? torrent_url : document.search(link_xpath).first[:href],
12
13
  :image => document.search('var.postImg').first[:title]
13
14
  }
14
15
  end
@@ -1,3 +1,3 @@
1
1
  module NnmClubApi
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "rspec"
24
24
  spec.add_development_dependency "guard-rspec"
25
25
 
26
- spec.add_dependency "mechanize", "2.7.3"
27
- end
26
+ spec.add_dependency "mechanize", "2.7.2"
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nnmClub_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Baranov Sergey
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 2.7.3
75
+ version: 2.7.2
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: 2.7.3
82
+ version: 2.7.2
83
83
  description: Gem for parsing NoNaMe Club torrent-tracker.
84
84
  email:
85
85
  - sergey@drummer.ru