-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
753 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Changed From The Original | ||
========================= | ||
This is defenitly the "embedly" fork. I replaced everything I could from oohembed.com with embedly. oohembed.com has been running into rate issued with google app engine, so I am just trying to relive the pressure. | ||
|
||
All the supported embedly urls are built from the embeddly json file of simple regexps, which can be found at [http://api.embed.ly/static/data/embedly_regex.json](http://api.embed.ly/static/data/embedly_regex.json) | ||
|
||
Adding a folder for testing all the possible urls. I am not sure what the best way to do this is, if some one who is more familiar with ruby can explain a better way of doing that I would be much appreciated. | ||
|
||
I also included a url file, provided by embedlly as well, so that the library can check for urls that work or not. | ||
|
||
There should probably two types of url checks, one for wellformedness, that doesn't make an HTTP call, and then one to see if the actual url works. | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require 'rubygems' | ||
require File.dirname(__FILE__) + '/../lib/oembed' | ||
OEmbed::Providers.register_all() | ||
OEmbed::Providers.register_fallback(OEmbed::ProviderDiscovery, OEmbed::Providers::Embedly, OEmbed::Providers::OohEmbed) | ||
|
||
|
||
passed = "passed" | ||
passed = "failed" | ||
File.open("test_urls.csv", "r") do |infile| | ||
while (line = infile.gets) | ||
begin | ||
res = OEmbed::Providers.raw(line, :format => :json) | ||
passed = "passed" | ||
rescue OEmbed::NotFound => e | ||
if e.message == "OEmbed::NotFound" | ||
puts "not a supported url: " + line | ||
else | ||
puts e.message | ||
end | ||
passed = "failed" | ||
rescue OEmbed::UnknownResponse => e | ||
puts "got a bad network response" + e.message | ||
passed = "failed" | ||
rescue Timeout::Error | ||
puts "timeout error" | ||
passed = "failed" | ||
end | ||
|
||
puts passed + ": " + line | ||
end | ||
end |
Oops, something went wrong.