Skip to content
A Ruby on Rails plugin that streamlines interactions with the Scribd service
Ruby
Pull request Compare This branch is 2 commits ahead, 135 commits behind mdarby:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
MIT-LICENSE
README.textile
Rakefile
init.rb
install.rb
scribd.yml.example
uninstall.rb

README.textile

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 & Use

  1. Install the rscribd gem
    
    gem install rscribd
    
  2. Install the plugin
    
    ./script/plugin install git://github.com/mdarby/scribd_fu.git
    
  3. Enter the below line into any attachment_fu-using model that you’d like to Scribdify
    
    acts_as_scribd_document
    
  4. 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
    t.boolean :is_public
    
  5. Sign up for Scribd (it’s totally free)
  6. Copy the vendor/plugins/scribd.yml.example file to config/scribd.yml and fill out with your Scribd login credentials
  7. 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.

Access

You can set the default access on all documents by setting the ‘access’ key in the scribd.yml file to either ‘private’ or ‘public’

You can also override the default access level and control access on a per-document basis by setting the ‘is_public’ attribute to either true or false. If this column is not defined, the default option in the scribd.yml will be used.

Please note that setting the access level only works before the document is initially uploaded to Scribd.

Displaying

To view a Scribd document, just throw the below code into your view (where document is an object of your Scribd/Attachment_fu model): <pre><code> <%= display_scribd(document) %>

That’s it!

Notes

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.

About the Author

My name is Matt Darby. I’m a 29 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 or to recommend me

Something went wrong with that request. Please try again.