public
Description: Newzbin Library to search Newzbin
Clone URL: git://github.com/maddox/newzbin.git
Search Repo:
made the parameter input on initialize an options hash
maddox (author)
Wed Feb 20 19:54:04 -0800 2008
commit  72b7b64464d70957f2e00ba26fe4f0bae773265d
tree    6e8c3379e467e809e56743d79fe9ecce47f9a375
parent  0f7119bfb5c396acfc2bd89f294ec78e35a8ce49
...
8
9
10
11
 
12
13
14
15
16
17
18
 
 
 
 
19
20
21
...
8
9
10
 
11
12
13
14
 
 
 
 
15
16
17
18
19
20
21
0
@@ -8,14 +8,14 @@ module Newzbin
0
   class Connection
0
     attr_accessor :host, :search_path, :dnzb_path, :username, :password, :nzbSmoke, :nzbSessionID
0
 
0
- def initialize(nzbSmoke=nil, nzbSessionID=nil, username=nil, password=nil)
0
+ def initialize(options={})
0
       self.host = 'http://v3.newzbin.com'
0
       self.search_path = '/search/'
0
       self.dnzb_path = '/dnzb'
0
- self.username = username
0
- self.password = password
0
- self.nzbSmoke = nzbSmoke
0
- self.nzbSessionID = nzbSessionID
0
+ self.username = options[:username]
0
+ self.password = options[:password]
0
+ self.nzbSmoke = options[:nzbSmoke]
0
+ self.nzbSessionID = options[:nzbSessionID]
0
     end
0
 
0
     def http_get(url)
...
5
6
7
8
 
9
10
11
...
5
6
7
 
8
9
10
11
0
@@ -5,7 +5,7 @@
0
 
0
 require 'newzbin'
0
 
0
-newz = Newzbin::Connection.new("RKTU0McXx%24Uc4e4KXP1L0sl4O1U9YOchO%2B0DA%3D", "a0fed567eb1a3e6e95c8a3d46fe0c6e7", 'seven5', 'pass')
0
+newz = Newzbin::Connection.new(:nzbSmoke => "RKTU0McXx%24Uc4e4KXP1L0sl4O1U9YOchO%2B0DA%3D", :nzbSessionID => "a0fed567eb1a3e6e95c8a3d46fe0c6e7")
0
 nzbs = newz.search(:q => 'independence day', :ps_rb_video_format => 16, "category"=>"6", "commit"=>"search")
0
 # 1073741824
0
 #puts nzbs.inspect

Comments

    No one has commented yet.