<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Rakefile</filename>
    </added>
    <added>
      <filename>lib/embedit/provider.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/flv.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/google_video.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/image.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/ipernity.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/myspace.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/oembed.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/ovi.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/sevenload_video.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/twitter.rb</filename>
    </added>
    <added>
      <filename>lib/embedit/providers/youtube.rb</filename>
    </added>
    <added>
      <filename>rails/init.rb</filename>
    </added>
    <added>
      <filename>spec/google_video_spec.rb</filename>
    </added>
    <added>
      <filename>spec/sevenload_video_spec.rb</filename>
    </added>
    <added>
      <filename>spec/twitter_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -5,6 +5,8 @@ Embedit is an embedding tool written in Ruby.
 
 We are currently re-writing dothegreenthing.com and allow users to add media from pretty much anywhere. Handling all the different embed codes/api's validations and everything else that comes with this functionality can be/is a pain.
 
+Embedit is the backbone to the web service http://embedit.me. Embedit.me also has its only ruby lib over at http://github.com/reddavis/embedit_ruby/tree/master
+
 Embedit is extremely simple to use. You have the url? Just plonk it in here =&gt;
 
 media = Embedit::Media.new('here')
@@ -26,10 +28,20 @@ At the moment Embedit supports:
   - oEmbed family (http://www.oembed.com/) 
   - YouTube (http://youtube.com)
   - OVI (http://share.ovi.com/)
-  - Local files, I've had some problems with Rails (files not found), but using http://pandastream.com it works perfectly fine
+  - Google Video
+  - Sevenload Video
+  - .[jpg|gif|png] URL
+  - Twitter (twictur.es)
+  - Myspace Images
+  - FLV video stored where ever
   
 Sites To Support:
   - Facebook
   - Image shack
   - Screen shot of a website (user puts in url, if nothing matches take screen shot)
-  - Email me any other suggestions with links to the site at reddavis [[+@+]] gmail *.* com
\ No newline at end of file
+  - Email me any other suggestions with links to the site at reddavis [[+@+]] gmail *.* com
+  
+  Credits:
+
+  Red Davis (http://redwriteshere.com/) (http://github.com/reddavis/embedit/tree/master)
+  Michael Bumann - railslove.com
\ No newline at end of file</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,19 @@
 Gem::Specification.new do |s|
-  s.name = &quot;embedit&quot;
-  s.version = '0.0.9'
+  s.name = %q{embedit}
+  s.version = &quot;0.1.0&quot;
+
+  s.authors = [&quot;Red Davis&quot;, &quot;Michael Bumann&quot;]
   s.date = Time.now.to_s
-  s.summary = &quot;Ruby interface for embedding a range of media&quot;
   s.email = &quot;reddavis@gmail.com&quot;
-  s.homepage = &quot;http://github.com/reddavis/embedit/&quot;
-  s.has_rdoc = false
-  s.authors = [&quot;Red Davis&quot;]
-  s.files = [&quot;README&quot;, &quot;lib/embedit.rb&quot;, &quot;lib/providers.yaml&quot;, &quot;lib/embedit/media.rb&quot;, 
-             &quot;lib/embedit/oembed/providers.rb&quot;, &quot;lib/embedit/youtube/youtube.rb&quot;, &quot;lib/embedit/oembed/oembed.rb&quot;,
-             &quot;lib/embedit/exceptions.rb&quot;, &quot;lib/embedit/validate.rb&quot;, &quot;lib/embedit/ovi/ovi.rb&quot;, &quot;lib/embedit/player/player.rb&quot;,
-             &quot;spec/spec_helper.rb&quot;, &quot;spec/oembed_spec.rb&quot;, &quot;spec/youtube_spec.rb&quot;, 
-             &quot;spec/ovi_spec.rb&quot;, &quot;spec/player_spec.rb&quot;]
-end
\ No newline at end of file
+  s.files = [&quot;lib/embedit/exceptions.rb&quot;, &quot;lib/embedit/media.rb&quot;, &quot;lib/embedit/provider.rb&quot;, &quot;lib/embedit/providers/flv.rb&quot;, &quot;lib/embedit/providers/google_video.rb&quot;, 
+            &quot;lib/embedit/providers/image.rb&quot;, &quot;lib/embedit/providers/ipernity.rb&quot;, &quot;lib/embedit/providers/myspace.rb&quot;, &quot;lib/embedit/providers/oembed.rb&quot;, 
+            &quot;lib/embedit/providers/ovi.rb&quot;, &quot;lib/embedit/providers/sevenload_video.rb&quot;, &quot;lib/embedit/providers/twitter.rb&quot;, &quot;lib/embedit/providers/youtube.rb&quot;, 
+            &quot;lib/embedit/validate.rb&quot;, &quot;lib/embedit.rb&quot;, &quot;README&quot;, &quot;spec/google_video_spec.rb&quot;, &quot;spec/oembed_spec.rb&quot;, &quot;spec/ovi_spec.rb&quot;, &quot;spec/player_spec.rb&quot;, 
+            &quot;spec/sevenload_video_spec.rb&quot;, &quot;spec/twitter_spec.rb&quot;, &quot;spec/youtube_spec.rb&quot;]
+            
+  s.homepage = %q{http://github.com/reddavis/embedit}
+  s.require_paths = [&quot;lib&quot;]
+  s.summary = %q{Ruby interface for embedding a range of media.}
+  s.test_files = [&quot;spec/google_video_spec.rb&quot;, &quot;spec/oembed_spec.rb&quot;, &quot;spec/ovi_spec.rb&quot;, &quot;spec/player_spec.rb&quot;, &quot;spec/sevenload_video_spec.rb&quot;, &quot;spec/twitter_spec.rb&quot;, &quot;spec/youtube_spec.rb&quot;]
+
+end</diff>
      <filename>embedit.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -3,20 +3,21 @@ require 'json'
 require 'rexml/document'
 require 'net/http'
 require 'open-uri'
+require 'hpricot'
 require 'yaml'
 
 #Files
-require 'embedit/oembed/providers'
+require 'embedit/provider'
 require 'embedit/media'
-require 'embedit/oembed/oembed'
-require 'embedit/youtube/youtube'
-require 'embedit/ovi/ovi'
 require 'embedit/exceptions'
 require 'embedit/validate'
-require 'embedit/player/player'
+
+module Embedit
+end
 
 # Oembed
-#puts a = Embedit::Media.new('http://www.vimeo.com/1260077').title
+
+#puts a = Embedit::Media.new('http://www.vimeo.com/1263763').html
 
 #puts b = Embedit::Media.new('http://www.flickr.com/photos/reddavis999/2692043113/').html #valid? #.valid #.html(:height =&gt; 200)
 
@@ -42,6 +43,8 @@ require 'embedit/player/player'
 
 # Flash Player
 
-#puts a = Embedit::Media.new('../test.flv').html
+#puts a = Embedit::Media.new('http://twitter.com/kastner/statuses/939873832').html
+
+# MySpace Pictures
 
-#puts File.exists?(File.expand_path('test.flv'))
\ No newline at end of file
+#puts a = Embedit::Media.new('http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&amp;friendID=152417109&amp;albumID=0&amp;imageID=8797852').html(:height =&gt; 20)
\ No newline at end of file</diff>
      <filename>lib/embedit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,56 +2,41 @@ module Embedit
   
   class Media
     
-    attr_reader :title, :url, :format, :html
+    attr_accessor :title, :url, :format, :html, :provider
+    
+    
+    #delegate :title, :html, :format, :to =&gt; :provider
     
     def initialize(url)
-      @valid = true                                                 #Innocent until proven guilty
-      @oembed_providers = Providers.new.sites
-      find_provider(url)
-      rescue                                                        #Horrible hack, but flickrs poor status headers == :( 
-        @valid = false                                              #if it breaks, its gotta be invalid, I suggest removing when debugging                                                 
+      @valid    = true
+      @url      = url
+      @provider = Provider.find(url)
+      # The validation does a expensive GET request. needs to be fixed. (request only the headers?!) 
+      if !@provider || !Validate.new(@url).valid?
+        @valid = false
+        return
+      end 
+
+    rescue #Horrible hack, but flickrs poor status headers == :( 
+      @valid = false #if it breaks, its gotta be invalid, I suggest removing when debugging                                                 
     end
     
     def title
-      @media_data.title
+      self.provider.title if self.provider
     end
     
-    def html(size = {})
-      @media_data.html(size)
+    def html(args={})
+      args = {} if args.nil?
+      self.provider.html(args) if self.provider    
     end
     
     def format
-      @media_data.format
-    end
-    
-    def url
-      @media_data.url
+      self.provider.format if self.provider
     end
     
     def valid?
       @valid    
     end
     
-         
-    private    
-
-  #Find a provider
-    def find_provider(url)
-      return @valid = false unless Validate.new(url).valid?
-
-      @oembed_providers.keys.each do |key|                               #First search oembed providers for a match
-        if url.match(/(\.|\/)#{key}\./)                                  #URL can be www.vimeo.com || http://vimeo.com
-          return @media_data = Oembed.new(url, key)
-        end
-      end
-      if url.match(/(\.|\/)youtube\./)                                  #Next up is YouTube
-        return @media_data = YouTube.new(url)
-      elsif url.match(/share\.ovi\.com/)
-        return @media_data = Ovi.new(url)
-      elsif File.extname(url) != &quot;&quot; || nil
-        return @media_data = Player.new(url)
-      end
-        @valid = false
-    end
   end
 end</diff>
      <filename>lib/embedit/media.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,44 +1,22 @@
-class Validate
+module Embedit
+  class Validate
   
-  def initialize(url)
-    @url = url
-    @valid = check_url == true ? true : false
-  end
-  
-  def valid?
-    @valid
-  end
-    
-  private
+    def initialize(url)
+      @url = url
+      @valid = accessible? # &amp;&amp; add more tests here if needed
+    end
   
-  def check_url    
-    if (check_url_supported == true &amp;&amp; check_response == true) || (File.extname(@url) != &quot;&quot; || nil &amp;&amp; check_url_supported)    #We first check that the url is one actually supported by Embedit
-      return true
+    def valid?
+      @valid
     end
-  end
+    
+    private
   
-  def check_response
-    true if open(@url)    #Header codes are annoying, just check that the page works, the check with Embed::Media will narrow down more
-    rescue
+    def accessible?
+      true if @url.match(/(flv|jpg|png|gif|mp3)$/) || open(@url)    #Header codes are annoying, just check that the page works, the check with Embed::Media will narrow down more
+    rescue 
       false
-  end
-  
-  def check_url_supported
-    oembed_providers = Embedit::Providers.new.sites
-    oembed_providers.keys.each do |key|                       #First search oembed providers for a match
-      if @url.match(/(\.|\/)#{key}\./)                        #URL can be www.vimeo.com || http://vimeo.com
-        return true
-      end
     end
-    # Now we go through all services not linked with oEmbed
-    if @url.match(/(\.|\/)youtube\./)                         #All youtube links should end with a .com (Please correct if I'm wrong) they get redirected to jp.youtube.com or whatever                      
-      return true 
-    elsif @url.match(/share\.ovi\.com/)
-      return true
-    elsif File.extname(@url) != &quot;&quot; || nil
-      return true
-    end
-    return false                                              #Return false if all else fail
-  end
   
+  end
 end</diff>
      <filename>lib/embedit/validate.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/embedit/oembed/oembed.rb</filename>
    </removed>
    <removed>
      <filename>lib/embedit/oembed/providers.rb</filename>
    </removed>
    <removed>
      <filename>lib/embedit/ovi/ovi.rb</filename>
    </removed>
    <removed>
      <filename>lib/embedit/player/player.rb</filename>
    </removed>
    <removed>
      <filename>lib/embedit/youtube/youtube.rb</filename>
    </removed>
    <removed>
      <filename>lib/providers.yaml</filename>
    </removed>
    <removed>
      <filename>test.flv</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>21c67142ca88afef2996bb8931f34e01455f1de1</id>
    </parent>
  </parents>
  <author>
    <name>Red Davis</name>
    <email>reddavis@gmail.com</email>
  </author>
  <url>http://github.com/bumi/embedit/commit/d7dc86ff48c7b7b7297db7d18ac1b4b5f382f4f3</url>
  <id>d7dc86ff48c7b7b7297db7d18ac1b4b5f382f4f3</id>
  <committed-date>2008-10-02T17:18:29-07:00</committed-date>
  <authored-date>2008-10-02T17:18:29-07:00</authored-date>
  <message>0.1.0 bunch of updates see commit log</message>
  <tree>9d71809c4d2fcbb59d5c737995b25f92c4f6e59e</tree>
  <committer>
    <name>Red Davis</name>
    <email>reddavis@gmail.com</email>
  </committer>
</commit>
