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 CHANGED
@@ -6,7 +6,7 @@ require 'rake/testtask'
6
6
  require "rake/gempackagetask"
7
7
  require 'spec/rake/spectask'
8
8
 
9
- PKG_VERSION = "1.2.0"
9
+ PKG_VERSION = "1.2.1"
10
10
  PKG_NAME = "titlepage"
11
11
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
12
  RUBYFORGE_PROJECT = 'rbook'
@@ -5,9 +5,9 @@
5
5
  # require 'titlepage'
6
6
  require File.dirname(__FILE__) + '/../lib/titlepage'
7
7
 
8
- TitlePage::Client.open("rba303", "ra1nb0Wb") do |tp|
8
+ TitlePage::Client.open("username", "password") do |tp|
9
9
 
10
- puts tp.first("0091835135").to_yaml
10
+ puts tp.first("0091835135").inspect
11
11
  sleep 3
12
12
  puts tp.all("1741146712").inspect
13
13
 
@@ -5,11 +5,6 @@
5
5
  # require 'titlepage'
6
6
  require File.dirname(__FILE__) + '/../lib/titlepage'
7
7
 
8
- client = TitlePage::WWWClient.new
9
-
10
- client.login("username", "password")
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
@@ -30,7 +30,7 @@ module TitlePage
30
30
  data = [
31
31
  "posted=yes",
32
32
  "quicksearch=#{isbn}",
33
- "qsrchby=ean",
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.post('/index.php', data)
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.0
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-07-28 00:00:00 +10:00
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.4
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