This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 605a85d8022e1b27d44e20748f6652c84e9e635b
tree b8936aa8d9455512304d319b2a8cc1caa304909d
parent 34f3235450e1183cb6ebda8ca493980de214ecc1
tree b8936aa8d9455512304d319b2a8cc1caa304909d
parent 34f3235450e1183cb6ebda8ca493980de214ecc1
embedit /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
README | ||
| |
Rakefile | ||
| |
embedit.gemspec | ||
| |
lib/ | ||
| |
rails/ | ||
| |
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








