public
Description: A Ruby on Rails plugin that streamlines interactions with the Scribd service
Homepage: http://blog.matt-darby.com/category/code-stuff/scribd_fu/
Clone URL: git://github.com/mdarby/scribd_fu.git
scribd_fu / README
100644 62 lines (42 sloc) 2.747 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Scribd_fu
------------
A Ruby on Rails plugin that streamlines interaction with the Scribd service (scribd.com), and even works with Attachment_fu!
 
What it does
------------
Scribd_fu hides out in the shadows like a document converting ninja, just waiting to process your data into a convenient Flash format (like YouTube) with the help of the black majick of Scribd.com. Imagine imbedding huge documents right inline with your web UI, no downloading, no necessary programs on the client side to view your data. It’s pretty damned cool.
 
 
Requirements
------------
Scribd_fu requires the wicked awesome Attachment_fu plugin. You probably already have it installed.
You also need the rscribd gem (sudo gem install rscribd will do the trick)
 
 
How to Install
------------
Clone the git repository into your app’s vendor/plugins directory
cd vendor/plugins && git clone git://github.com/mdarby/scribd_fu.git
 
Install the rscribd gem
gem install rscribd
 
 
How to Use
------------
Enter the below line into any attachment_fu-using model that you’d like to Scribdify
acts_as_scribd_document
 
Add the following fields into a new migration for the target model (and update your schema!):
t.integer :scribd_id
t.string :scribd_access_key
 
Sign up for Scribd (it’s totally free)
 
Copy the vendor/plugins/scribd.yml.example file to config/scribd.yml and fill out with your Scribd login credentials
 
Now, when you upload a file that is convertible in the Scribd system, Scribd_fu will automatically handle the CRUD for you. No muss, no fuss.
 
Note that scribd_fu will only upload the file to scribd. Scribd then has to
convert it to their iPaper format. Usually this is a pretty fast operation, but
if you want to be safe or have a contingency plan in case someone tries to
access the document and it isn't converted yet, the set of methods
conversion_complete?, conversion_successful?, and conversion_error? can be used
to determine the current conversion status of the document.
 
To view a Scribd document, just throw the below code into your view (where @document is an object of your Scribd/Attachment_fu model):
<%= display_scribd(@document) %>
That’s it!
 
 
Further Info
------------
You can make your Scribd documents private or public, to choose, just modify the scribd.yml file and enter ‘private’ or ‘public’ in the ‘access’ key.
 
 
About the Author
------------
My name is Matt Darby. I’m a 28 year old professional Web Developer and IT Manager. I am the IT Manager and Lead Web Developer at Dynamix Engineering and recently earned a Master’s Degree in Computer Science from Franklin University in Columbus, OH.
 
Feel free to check out my blog (http://blgo.matt-darby.com) or to recommend me on http://workingwithrails.com