torrent_api 0.2.2 → 0.2.3
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.
- data/CHANGELOG +2 -1
- data/Rakefile +1 -1
- data/lib/pirate_bay/details.rb +3 -4
- data/lib/torrent_api.rb +2 -0
- data/torrent_api.gemspec +3 -3
- metadata +61 -37
data/CHANGELOG
CHANGED
@@ -7,4 +7,5 @@
|
|
7
7
|
v0.1.2 Fixed PirateBay filesizes to be in bytes.
|
8
8
|
v0.2.0 Added some PirateBay analysis methods for comments and their video/audio ratings. Specs begin.
|
9
9
|
v0.2.1 Added more api methods to the video/audio ratings
|
10
|
-
v0.2.2 No more NaN's being returned by average methods
|
10
|
+
v0.2.2 No more NaN's being returned by average methods
|
11
|
+
v0.2.3 Ruby 1.8.7 Support
|
data/Rakefile
CHANGED
data/lib/pirate_bay/details.rb
CHANGED
@@ -28,7 +28,6 @@ module PirateBay
|
|
28
28
|
|
29
29
|
def fetch_all_comments
|
30
30
|
comment_xhr_params.each do |params|
|
31
|
-
puts " fetching comments for #{params[:page]} of #{params[:pages]}"
|
32
31
|
fetch_comments params
|
33
32
|
end
|
34
33
|
end
|
@@ -52,12 +51,12 @@ module PirateBay
|
|
52
51
|
document = Nokogiri::HTML(@details_page_html)
|
53
52
|
comment_link = document.css('div.browse-coms a').first
|
54
53
|
if comment_link.nil?
|
55
|
-
[{ page
|
54
|
+
[{ :page => 1, :pages => 1, :crc => "9b235c98e242f2617ae61dc416ec0de7", :id => @id }]
|
56
55
|
else
|
57
56
|
params = PirateBay::Details.extract_xhr_params comment_link.attr('onclick')
|
58
57
|
results = Array.new(params[:pages]) { |i| i+1 }
|
59
58
|
results.map do |i|
|
60
|
-
{ page
|
59
|
+
{ :page => i, :pages => params[:pages], :crc => params[:crc], :id => params[:id] }
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
@@ -67,7 +66,7 @@ module PirateBay
|
|
67
66
|
page, pages, crc, id = /comPage\((\d+),(\d+),'(.+)', '(.+)'\);/.match(string).captures
|
68
67
|
page = page.to_i
|
69
68
|
pages = pages.to_i
|
70
|
-
{ page
|
69
|
+
{ :page => page, :pages => pages, :crc => crc, :id => id }
|
71
70
|
end
|
72
71
|
|
73
72
|
|
data/lib/torrent_api.rb
CHANGED
data/torrent_api.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "torrent_api"
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["James Hart"]
|
9
|
-
s.date = "2011-11-
|
9
|
+
s.date = "2011-11-15"
|
10
10
|
s.description = "An API to query popular torrent websites"
|
11
11
|
s.email = "hjhart@gmail.com"
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "README.markdown", "lib/demonoid/base.rb", "lib/demonoid/result.rb", "lib/demonoid/result_set.rb", "lib/pirate_bay/base.rb", "lib/pirate_bay/categories.rb", "lib/pirate_bay/details.rb", "lib/pirate_bay/result.rb", "lib/pirate_bay/result_set.rb", "lib/torrent_api.rb", "lib/torrent_reactor/base.rb", "lib/torrent_reactor/result.rb", "lib/torrent_reactor/result_set.rb"]
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Torrent_api", "--main", "README.markdown"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.rubyforge_project = "torrent_api"
|
18
|
-
s.rubygems_version = "1.8.
|
18
|
+
s.rubygems_version = "1.8.11"
|
19
19
|
s.summary = "An API to query popular torrent websites"
|
20
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,43 +1,57 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: torrent_api
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- James Hart
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2011-11-15 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: nokogiri
|
16
|
-
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
17
24
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
22
32
|
type: :runtime
|
23
|
-
|
24
|
-
|
25
|
-
- !ruby/object:Gem::Dependency
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
26
35
|
name: hpricot
|
27
|
-
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
38
|
none: false
|
29
|
-
requirements:
|
30
|
-
- -
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
33
46
|
type: :runtime
|
34
|
-
|
35
|
-
version_requirements: *2153188880
|
47
|
+
version_requirements: *id002
|
36
48
|
description: An API to query popular torrent websites
|
37
49
|
email: hjhart@gmail.com
|
38
50
|
executables: []
|
51
|
+
|
39
52
|
extensions: []
|
40
|
-
|
53
|
+
|
54
|
+
extra_rdoc_files:
|
41
55
|
- CHANGELOG
|
42
56
|
- README.markdown
|
43
57
|
- lib/demonoid/base.rb
|
@@ -52,7 +66,7 @@ extra_rdoc_files:
|
|
52
66
|
- lib/torrent_reactor/base.rb
|
53
67
|
- lib/torrent_reactor/result.rb
|
54
68
|
- lib/torrent_reactor/result_set.rb
|
55
|
-
files:
|
69
|
+
files:
|
56
70
|
- CHANGELOG
|
57
71
|
- Manifest
|
58
72
|
- README.markdown
|
@@ -72,32 +86,42 @@ files:
|
|
72
86
|
- torrent_api.gemspec
|
73
87
|
homepage: http://www.github.com/hjhart/torrent_api
|
74
88
|
licenses: []
|
89
|
+
|
75
90
|
post_install_message:
|
76
|
-
rdoc_options:
|
91
|
+
rdoc_options:
|
77
92
|
- --line-numbers
|
78
93
|
- --inline-source
|
79
94
|
- --title
|
80
95
|
- Torrent_api
|
81
96
|
- --main
|
82
97
|
- README.markdown
|
83
|
-
require_paths:
|
98
|
+
require_paths:
|
84
99
|
- lib
|
85
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
101
|
none: false
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
|
91
|
-
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
110
|
none: false
|
93
|
-
requirements:
|
94
|
-
- -
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
hash: 11
|
115
|
+
segments:
|
116
|
+
- 1
|
117
|
+
- 2
|
118
|
+
version: "1.2"
|
97
119
|
requirements: []
|
120
|
+
|
98
121
|
rubyforge_project: torrent_api
|
99
|
-
rubygems_version: 1.8.
|
122
|
+
rubygems_version: 1.8.11
|
100
123
|
signing_key:
|
101
124
|
specification_version: 3
|
102
125
|
summary: An API to query popular torrent websites
|
103
126
|
test_files: []
|
127
|
+
|