nnmClub_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/lib/nnmClub_api/torrent.rb +3 -2
- data/lib/nnmClub_api/version.rb +1 -1
- data/nnmClub_api.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d5291177417e6d6c8309cec9361928d80d4a1d0
|
4
|
+
data.tar.gz: 63d3199fbb56fa31c7ad68ea9ca509f521cd9a65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f768885731a6ef23c377be576a9bab3ac1e10ebfe043cf91ab78d4004842c947b73e3ef66fd652b2edab47b71ad857db90bc351cc98aa34c062befe9d4a59e1
|
7
|
+
data.tar.gz: 3100f8621e66abc43d7739cd98256be262d2fb4d42da6e1e086291647c4db3143c30bfc2b3fdc1da48d233707bb44da311d4203606450c3244fcc8483d34a580
|
data/lib/nnmClub_api/torrent.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
module NnmClub
|
2
2
|
class Torrent
|
3
3
|
def self.find(torrent_id, agent = Mechanize.new)
|
4
|
-
|
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? ?
|
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
|
data/lib/nnmClub_api/version.rb
CHANGED
data/nnmClub_api.gemspec
CHANGED
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.
|
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.
|
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.
|
82
|
+
version: 2.7.2
|
83
83
|
description: Gem for parsing NoNaMe Club torrent-tracker.
|
84
84
|
email:
|
85
85
|
- sergey@drummer.ru
|