github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

bumi / embedit forked from reddavis/embedit

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 1
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Embed media easily into your site — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

fixed copy and paste error - add MP3 class 
Michael Bumann (author)
Fri Oct 10 11:45:54 -0700 2008
commit  f317bb0b828038cccb7e1837fb09baac302f02f9
tree    534e1066982928c335488e89ea7fb97315aadfec
parent  605a85d8022e1b27d44e20748f6652c84e9e635b
embedit /
name age
history
message
file .gitignore Loading commit data...
file README
file Rakefile
file embedit.gemspec
directory lib/
directory rails/
directory spec/
README
Embedit
-------

Embedit is an embedding tool written in Ruby.


Embedit is extremely simple to use. You have the url? Just plonk it in here =>

media = Embedit::Media.new('{URL}')

Thats it!

At the time of writing, you now have the ability to call:
  media.title => Shows the title of whatever was uploaded
  media.format => The format of the file
  media.url => The url to the media
  media.html => The embed code, whether this is a generic flash player, a company player (Vimeo, Youtube), image tag and 
  more to come
  
  You also specify media sizes => media.html(:width => 200, :height => 700)
  
  You can also validate an url (useful for a active record (or whatever you use) validation)
  media.valid? => Returns true or false

  
At the moment Embedit supports: 
  - oEmbed family (http://www.oembed.com/) 
  - YouTube (http://youtube.com)
  - OVI (http://share.ovi.com/)
  - Google Video
  - Sevenload Video
  - .[jpg|gif|png] URL
  - Twitter (twictur.es)
  - Amazon product (thanks to: oohembed.com)
  - Slideshare (thanks to: oohembed.com)


How to add a new provider:

Every provider is a Class in the lib/embedit/providers folder. 
(Note that you need to name it correctly (for example: class name: SevenloadVide - filename: sevenload_video.rb))
Every provider should respond to: 
  - html(options={})
  - title 
  - format
  - url 
and there should be a class method "match" that accepts the URL as parameter and returns a match object or nil. 


Credits:

Red Davis (http://redwriteshere.com/) (http://github.com/reddavis/embedit/tree/master)
Michael Bumann - railslove.com 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server