titlepage 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/examples/titlepage.rb +2 -2
- data/examples/titlepage_www.rb +3 -8
- data/lib/titlepage/wwwclient.rb +3 -2
- metadata +3 -3
data/Rakefile
CHANGED
data/examples/titlepage.rb
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
# require 'titlepage'
|
6
6
|
require File.dirname(__FILE__) + '/../lib/titlepage'
|
7
7
|
|
8
|
-
TitlePage::Client.open("
|
8
|
+
TitlePage::Client.open("username", "password") do |tp|
|
9
9
|
|
10
|
-
puts tp.first("0091835135").
|
10
|
+
puts tp.first("0091835135").inspect
|
11
11
|
sleep 3
|
12
12
|
puts tp.all("1741146712").inspect
|
13
13
|
|
data/examples/titlepage_www.rb
CHANGED
@@ -5,11 +5,6 @@
|
|
5
5
|
# require 'titlepage'
|
6
6
|
require File.dirname(__FILE__) + '/../lib/titlepage'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
text = client.get_onix_file("9780060000707")
|
13
|
-
puts text
|
14
|
-
|
15
|
-
client.logout
|
8
|
+
TitlePage::WWWClient.open("username","password") do |client|
|
9
|
+
puts client.get_onix_file("9780060000707")
|
10
|
+
end
|
data/lib/titlepage/wwwclient.rb
CHANGED
@@ -30,7 +30,7 @@ module TitlePage
|
|
30
30
|
data = [
|
31
31
|
"posted=yes",
|
32
32
|
"quicksearch=#{isbn}",
|
33
|
-
"qsrchby=
|
33
|
+
"qsrchby=isbn13",
|
34
34
|
"detailed=Search"
|
35
35
|
].join("&")
|
36
36
|
http.post('/results.php', data, headers)
|
@@ -60,7 +60,8 @@ module TitlePage
|
|
60
60
|
"pwd=#{password}",
|
61
61
|
"login=Login"
|
62
62
|
].join("&")
|
63
|
-
http.
|
63
|
+
headers = { 'Referer' => 'http://www.titlepage.com/index.php' }
|
64
|
+
http.post('/index.php', data, headers)
|
64
65
|
end
|
65
66
|
@cookie = login_response['set-cookie']
|
66
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: titlepage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Healy
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-12 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements: []
|
93
93
|
|
94
94
|
rubyforge_project: rbook
|
95
|
-
rubygems_version: 1.3.
|
95
|
+
rubygems_version: 1.3.5
|
96
96
|
signing_key:
|
97
97
|
specification_version: 3
|
98
98
|
summary: A library for using the titlepage.com API
|