public
Fork of reddavis/embedit
Description: Embed media easily into your site
Homepage:
Clone URL: git://github.com/bumi/embedit.git
embedit / README
100644 53 lines (36 sloc) 1.581 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
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