rscribd 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.1.1 / 2008-10-6
2
+
3
+ * Fixed bug that occurs when parsing empty elements.
4
+
1
5
  === 0.1.0 / 2008-10-1
2
6
 
3
7
  * Changed Scribd::Document.find method to take an ActiveRecord-style scope
data/README.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  = rscribd
2
2
 
3
- * 0.1.0 (Oct 1, 2008)
3
+ * 0.1.1 (Oct 6, 2008)
4
4
 
5
5
  == DESCRIPTION:
6
6
 
data/Rakefile CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'rubygems'
4
4
  require 'hoe'
5
5
 
6
- Hoe.new('rscribd', '0.1.0') do |p|
6
+ Hoe.new('rscribd', '0.1.1') do |p|
7
7
  p.rubyforge_name = 'rscribd'
8
8
  p.author = 'Jared Friedman'
9
9
  p.email = 'api@scribd.com'
@@ -144,7 +144,7 @@ module Scribd
144
144
  @attributes.clear
145
145
  xml.each_element do |element|
146
146
  text = if element.text.nil? or element.text.chomp.strip.empty? then
147
- element.cdatas ? element.cdatas.first.value : nil
147
+ (element.cdatas and not element.cdatas.empty?) ? element.cdatas.first.value : nil
148
148
  else
149
149
  element.text
150
150
  end
data/sample/01_upload.rb CHANGED
@@ -4,8 +4,8 @@ require 'rubygems'
4
4
  require 'rscribd'
5
5
 
6
6
  # Use your API key / secret here
7
- api_key = ''
8
- api_secret = ''
7
+ api_key = '4lj2rs4duuv4013y2qbw3'
8
+ api_secret = 'sec-twkc39qf22dmplhy3j4flvzet'
9
9
 
10
10
  # Create a scribd object
11
11
  Scribd::API.instance.key = api_key
@@ -13,35 +13,7 @@ Scribd::API.instance.secret = api_secret
13
13
  #Scribd::API.instance.debug = true
14
14
 
15
15
  begin
16
- Scribd::User.login 'LOGIN', 'PASSWORD'
17
- # Upload the document from a file
18
- print "Uploading a document ... "
19
-
20
- doc = Scribd::Document.upload(:file => 'test.txt')
21
- puts "Done doc_id=#{doc.id}, doc_access_key=#{doc.access_key}"
22
-
23
- # Poll API until conversion is complete
24
- while (doc.conversion_status == 'PROCESSING')
25
- puts "Document conversion is processing"
26
- sleep(2) # Very important to sleep to prevent a runaway loop that will get your app blocked
27
- end
28
- puts "Document conversion is complete"
29
-
30
- # Edit various options of the document
31
- # Note you can also edit options before your doc is done converting
32
- doc.title = 'This is a test doc!'
33
- doc.description = "I'm testing out the Scribd API!"
34
- doc.access = 'private'
35
- doc.language = 'en'
36
- doc.license = 'c'
37
- doc.tags = 'test,api'
38
- doc.show_ads = true
39
- doc.save
40
-
41
- # Delete the uploaded document
42
- print "Deleting a document ... "
43
- doc.destroy
44
- puts "Done doc_id=#{doc.id}"
16
+ p Scribd::User.login 'NoNameDude', 'NoNamePassword'
45
17
  rescue Scribd::ResponseError => e
46
18
  puts "failed code=#{e.code} error='#{e.message}'"
47
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rscribd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Friedman
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-01 00:00:00 -07:00
12
+ date: 2008-10-06 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency