ruby-oembed-0.8.14/ 0000755 0000041 0000041 00000000000 12546055651 014057 5 ustar www-data www-data ruby-oembed-0.8.14/Rakefile 0000644 0000041 0000041 00000000327 12546055651 015526 0 ustar www-data www-data begin
require "bundler/gem_tasks"
rescue LoadError
puts "Bundler not available. Install it with: gem install bundler"
end
Dir[File.join(File.dirname(__FILE__), "lib/tasks/*.rake")].sort.each { |ext| load ext }
ruby-oembed-0.8.14/Gemfile 0000644 0000041 0000041 00000000047 12546055651 015353 0 ustar www-data www-data source "https://rubygems.org"
gemspec
ruby-oembed-0.8.14/CHANGELOG.rdoc 0000644 0000041 0000041 00000014363 12546055651 016226 0 ustar www-data www-data = CHANGELOG
== 0.8.14 - 25 April 2015
* Change built-in Vimeo provider to use https oembed endpoint; Pull #44 (Jonne Haß)
* Change built-in Flickr provider to use https oembed endpoint; Pull #46 (Javan Makhmali)
* Change built-in Flickr provider to recognize https URLs and short flic.kr URLs (Javan Makhmali & Marcos Wright-Kuhns)
== 0.8.13 - 23 April 2015
* Change built-in Instagram provider to recognize https URLs; Pull #35 (Philipp Bosch)
* Change built-in Instagram provider to use https oembed/API endpoint. (Marcos Wright-Kuhns)
* Updated the list of {Embedly}[http://embed.ly] URL schemes. (Marcos Wright-Kuhns)
== 0.8.12 - 7 January 2015
* Fix URI error in Ruby 2.2; Pull #41, Issue #43 (Maxim Bublis)
* Change built-in YouTube provider to return https embeds; Pull #34, Issue #33 (Fla)
* Add built-in providers for Twitter, Vine, & Imgur; Pull #42 (Eliot Shepard)
* Updated the list of {Embedly}[http://embed.ly] URL schemes. (Marcos Wright-Kuhns)
== 0.8.11 - 7 November 2014
* Add built-in provider for Spotify; Pull #36 (Sami Kukkonen)
* Update Travis CI configuration to test with modern Rails; Pull #37 (Sami Kukkonen)
== 0.8.10 - 6 August 2014
* Add support for specifying a Provider#get `:timeout`; Pull #35 (Blake Thomson)
* Upgrade to RSpec 3.x
== 0.8.9 - 15 September 2013
* SoundCloud provider supports https URLs; Pull #30 (Greg Tangey)
* Address rspec DEPRECATION warnings; Pull metavida#3 (Marcos Wright Kuhns)
== 0.8.8 - 18 November 2012
* OEmbed::Response::Photo#html now includes alt attribute; Pull #23 & #25 (François de Metz)
* Always escape the url query param when requesting a resource from a provider; Pull #26 (Michael Cohen)
* Allow query params in a provider endpoint URL; Pull #27 (Michael Andrews)
* Added built-in provider for Skitch; Pull #24 (François de Metz)
* Updated built-in Vimeo provider (Marcos Wright Kuhns)
* For developers who work on this gem, removed the dependency on jeweler (Marcos Wright Kuhns)
== 0.8.7 - 11 March 2012
* Support for https provider endpoints; Issue #16 (Marcos Wright Kuhns)
* OEmbed::Providers.register_all now actually registers all bundled providers; Issue #18 (Marcos Wright Kuhns)
* Added built-in provider for SoundCloud (Hendrik Mans)
* Updated the list of {Embedly}[http://embed.ly] URL schemes. (Marcos Wright Kuhns)
* For developers who work on this gem, the rvmrc now automatically creates an oembed gemset; Issue #20 (Florian Staudacher)
== 0.8.5 - 14 November 2011
* Fixed problems ProviderDiscovery and some xml endpoints. Also added much better test coverage. (Marcos Wright Kuhns)
* Added support for XML parsing using {Nokogiri}[http://nokogiri.org/] (Marcos Wright Kuhns)
* Added built-in provider for MLG.TV (Matt Wilson)
* Added https support to the built-in YouTube provider (Marcos Wright Kuhns)
* Updated the list of {Embedly}[http://embed.ly] URL schemes. (Marcos Wright Kuhns)
== 0.8.3 - 26 June 2011
* Fixing a circular dependency introduced during my recent Jeweler upgrade. (Marcos Wright Kuhns)
== 0.8.2 - 25 June 2011
* Added built-in providers for Instagram, Slideshare and Yfrog (Florian Günther)
* Improved support (and error detection) for custom OEmbed::Formatter backends. (Marcos Wright Kuhns)
* DRYed up OEmbed::Formatter::JSON and XML methods into OEmbed::Formatter::Base (Marcos Wright Kuhns)
* More consistently raise an OEmbed::Parse error if there is any sort of problem parsing the server response, whether it's an expected error type or not. (Marcos Wright Kuhns)
* Added in-code comments about the {OohEmbed}[http://oohembed.com] service becoming part of {Embedly}[http://embed.ly] (Marcos Wright Kuhns)
* Updated the list of {Embedly}[http://embed.ly] URL schemes. (Marcos Wright Kuhns)
== 0.8.1 - 27 February 2011
* Removed all dependencies on external gems. XML is parsed using REXML and JSON can be parsed using YAML thanks to the convert_json_to_yaml method borrowed from Rails! (Marcos Wright Kuhns)
* Fixed several errors that cropped up when the json gem wasn't installed. (Marcos Wright Kuhns)
* OEmbed::Response#field now always return Strings. Previously, some JSON values were parsed into other Object types, like Integer and Float instances.
* OEmbed::Response#url has been renamed OEmbed::Response#request_url because OEmbed::Response::Photo#url should be the URL of the static photo to be used by the oEmbed consumer.
* OEmbed::Response.create_for now requires the format parameter.
* OEmbed::Formatter backends won't try to load gems that haven't already been loaded. (Marcos Wright Kuhns)
* Better code documentation, all around. (Marcos Wright Kuhns)
=== Deprecations & Removals
* Removed the OEmbed::Response::METHODS constant.
* OEmbed::Provders::Pownce has been removed since pownce.com is no longer active.
* Provider#url and Provider#name will be removed at some point in the future.
* All direct raw calls will be made private at some point in the future (i.e. Provider#raw, Providers#raw, and ProviderDiscovery#raw)
== 0.8.0 - Not Publicly Released
* Added OEmbed::Formatter Backends, to remove the dependency on the json gem and make adding support for other parsing libraries easier. This also fixes GitHub Issue =1. (Marcos Wright Kuhns)
* Catch invalid endpoint URLs on OEmbed::Provider instantiation. (Marcos Wright Kuhns)
* Jeweler uses the new OEmbed::Version Class. (Marcos Wright Kuhns)
* Corrected syntax for Youtube provider in the README (Ryan Richards)
* Removed the deprecated rails/init.rb file. (Marcos Wright Kuhns)
== 0.7.6 - 11 October 2010
* Released all recent changes to judofyr/master on GitHub. (Marcos Wright Kuhns)
* Added CHANGELOG & LICENSE information. (Marcos Wright Kuhns)
== 0.7.5 - 29 September 2010
* Updated the list of {Embedly}[http://embed.ly] URL schemes. (Aris Bartee)
* {rvmrc file}[http://rvm.beginrescueend.com/workflow/rvmrc/] added. (Aris Bartee)
== 0.7.0 - 23 August 2010
* Gemified. (Aris Bartee)
* Added the {Embedly}[http://embed.ly] Provider. (Alex Kessinger)
* OEmbed::Response now includes the original request url. (Colin Shea)
* Unregistering providers with duplicate URL patterns works. (Marcos Wright Kuhns)
== 0.0.0 - May 2008 - July 2010
* Initial work & release as a library (Magnus Holm, et al.)
* Many Providers supported, including {OohEmbed}[http://oohembed.com].
* Support for JSON (via the json gem) and XML (via the xml-simple gem).
ruby-oembed-0.8.14/integration_test/ 0000755 0000041 0000041 00000000000 12546055651 017441 5 ustar www-data www-data ruby-oembed-0.8.14/integration_test/test.rb 0000644 0000041 0000041 00000001705 12546055651 020750 0 ustar www-data www-data 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
ruby-oembed-0.8.14/integration_test/test_urls.csv 0000644 0000041 0000041 00000063464 12546055651 022217 0 ustar www-data www-data http://www.clearspring.com/widgets/4974d21ab04fa9e2
http://www.clearspring.com/widgets/4713b18f59796b09
http://www.clearspring.com/widgets/48613409efac8054
http://www.clearspring.com/widgets/49ad8cd4c63272f6/49b065bd0f0d6f05
http://www.clearspring.com/widgets/4702b4df5a93e1de
http://www.clearspring.com/widgets/48fe1eaf11d0f95c
http://www.clearspring.com/widgets/4727a250e66f9723?p=4a2d4ef4dcb2c3cf&flv=configxmlPath%3Dhttp%253A%252F%252Fvideo.nbcuni.com%252Fwidgetxml%252FsingleClip1%252Fsingleclip_omniConfig.xml%26logoLink%3Dhttp%253A%252F%252Fwww.nbc.com%253Fvty%2520%253D%2520f
http://www.clearspring.com/widgets/48f203eebb67a86f
http://www.clearspring.com/widgets/46dddf2c2ca0d939
http://tweetphoto.com/13677776
http://tweetphoto.com/13332027
http://tweetphoto.com/12887091
http://tweetphoto.com/15513196
http://tweetphoto.com/6554447
http://tweetphoto.com/13429958
http://tweetphoto.com/13897531
http://tweetphoto.com/7446386
http://tweetphoto.com/15112092
http://tweetphoto.com/6169634
http://www.flickr.com/photos/barackobamadotcom/2891789396/in/set-72157607533135519/
http://www.flickr.com/photos/barackobamadotcom
http://www.flickr.com/photos/joshuatree/2994352588/
http://www.flickr.com/photos/jurvetson/2816735522/
http://www.flickr.com/photos/jurvetson/2175936409/
http://www.flickr.com/photos/53074154@N00/4398838944/
http://www.flickr.com/photos/benheine/2384869433/
http://www.flickr.com/photos/mattwright/400394507/
http://www.flickr.com/photos/stijnvogels/365950522/
http://www.twitpic.com/jwnc
http://twitpic.com/afod4
http://twitpic.com/hcfc
http://twitpic.com/k1nf
http://twitpic.com/k3xp
http://twitpic.com/jsc1
http://www.twitpic.com/6eowb
http://twitpic.com/k3y7
http://twitpic.com/115112
http://twitpic.com/jj8p
http://imgur.com/O7rgP
http://imgur.com/gallery/QV50C
http://twitgoo.com/ab3ur
http://twitgoo.com/h0p
http://twitgoo.com/5upeb
http://twitgoo.com/4f9mp
http://twitgoo.com/mmg
http://twitgoo.com/lhavr/?format=rss
http://twitgoo.com/2s9dw
http://twitgoo.com/4p0y0
http://twitgoo.com/cqs2
http://twitgoo.com/4p0y0/?format=rss
http://www.qwantz.com/index.php?comic=1585
http://www.23hq.com/robertworstell/photo/5463838?globaltag=washington
http://www.23hq.com/astreim/photo/3564200?globaltag=geo%3Alat%3D39.966839
http://www.23hq.com/robertworstell/photo/5339188
http://www.23hq.com/robertworstell/photo/5495540?globaltag=car
http://www.23hq.com/robertworstell/photo/5495667?globaltag=politics
http://www.23hq.com/justindula/photo/3308705?globaltag=exterior
http://www.23hq.com/justindula/photo/3308706
http://www.23hq.com/steffen/photo/1796911
http://www.23hq.com/robertworstell/photo/5495630?globaltag=politics
http://www.amazon.com/Obama-Nation-Leftist-Politics-Personality/dp/B001RTS90Q
http://www.amazon.com/Obama-Postmodern-Webster-Griffin-Tarpley/dp/0930852893
http://www.amazon.com/Audacity-Win-Lessons-Historic-Victory/dp/0670021334
http://www.amazon.com/Barack-Obama-Larry-Sinclair-Cocaine/dp/0578013878
http://www.amazon.com/Obama-Movement-Barack-Speaks-Americas/dp/0595467032
http://www.youtube.com/watch?v=hKe1gUgX5do
http://www.youtube.com/watch?v=wKsoXHYICqU
http://www.youtube.com/watch?v=acc6Wn_BWlk&feature=player_embedded
http://www.youtube.com/watch?v=_3nLaaPLimM
http://www.youtube.com/watch?v=11gmqODMX44
http://www.youtube.com/watch?v=CJu0DgpiK8c
http://youtube.com/watch?v=21YF7ggCG6g&feature=related
http://www.youtube.com/watch?v=-EnXxXEhEbk
http://www.veoh.com/collection/citizenkate/watch/v15862192bZWP635t
http://www.veoh.com/browse/videos/category/news_politics/watch/v15828113MBPcHeCG
http://www.justin.tv/barack_obama_official/profile
http://www.justin.tv/clip/2dce45e25932a3f8
http://www.justin.tv/clip/f58ddc3c986
http://www.justin.tv/obama_tv
http://www.justin.tv/clip/4b4dde17174
http://www.justin.tv/lathedj/all
http://www.justin.tv/ikeoo/schedule
http://www.justin.tv/obama2008
http://www.justin.tv/barackobama09
http://en.justin.tv/clip/d501c15594c55d54
http://qik.com/obama
http://qik.com/video/239291
http://qik.com/video/1756223
http://qik.com/video/524330
http://qik.com/video/885844
http://qik.com/video/891638
http://qik.com/video/891609
http://qik.com/video/891442
http://qik.com/video/1805702
http://qik.com/video/359372
http://revision3.com/diggreel/vier
http://revision3.com/bestof/diggreel-0092
http://www.twitvid.com/6A55E
http://www.twitvid.com/CDEF5
http://www.twitvid.com/23590
http://www.twitvid.com/F8EFF
http://www.twitvid.com/F9608
http://www.twitvid.com/759BB
http://www.twitvid.com/35A93
http://www.twitvid.com/FA6E8
http://www.twitvid.com/TL86A
http://www.twitvid.com/ACAEF
http://www.break.com/usercontent/2009/5/afl-cios-richard-trumka-on-racism-and-obama-741633.html
http://www.break.com/usercontent/2008/5/Fox-News-Jokes-About-Killing-Obama-508522.html
http://www.break.com/usercontent/2010/2/17/cia-columbia-obama-cover-up-1735281
http://www.break.com/usercontent/2009/9/eric-cantor-taken-aback-by-obama-s-address-to-congress-1292023.html
http://www.break.com/usercontent/2010/1/barack-obama-is-chicago-cfr-elite-a-skull-bones-approved-pa-1611302
http://www.break.com/usercontent/2008/2/california-democratic-2008-debate-with-obama-and-h-446240.html
http://www.break.com/usercontent/2009/8/obama-gives-up-on-healthcare-public-option-1161443.html
http://www.break.com/usercontent/2009/8/michelle-obama-and-cindy-mccain-vying-for-jackie-o-kennedy-st-1174603.html
http://www.break.com/index/obamas-jokes-at-correspondents-dinner.html
http://www.break.com/index/bush-girl-meets-obama-girl.html
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=28160463
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=23954389
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=24299724
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=26828353
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=45478652
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=27620201
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=28296055
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=21117623
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&VideoID=45892506
http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=26175985
http://www.metacafe.com/watch/1967425/obama_wins_election/
http://www.metacafe.com/watch/yt-2A8AYa5JqmU/obama_speech_to_congress_part_1_6/
http://www.metacafe.com/watch/1910004/obama/
http://www.metacafe.com/watch/yt-8FBQ4D74Kt4/colin_powell_destroys_both_joe_the_plumber_and_mccains_campaign_while_endorsing_obama/
http://www.metacafe.com/watch/1305819/john_f_kennedy_barack_obama/
http://www.metacafe.com/watch/yt-491_5WxfcgI/obamas_tax_plan_penn_teller_and_gang_return_to_comment_on_b/
http://www.metacafe.com/watch/3094209/obama_calls_police_stupid/
http://www.metacafe.com/watch/yt-ato7BtisXzE/sen_barack_obamas_full_speech_to_the_dnc/
http://www.metacafe.com/watch/1970735/2008_obama_election_victory_world_reaction_more/
http://www.metacafe.com/watch/2108990/time_has_come_obama_or_mccain_you_choose_your_vote_is_important_to_the_usa/
http://www.blip.tv/file/3259184
http://blip.tv/file/644911
http://blip.tv/file/663377
http://blip.tv/file/657385
http://blip.tv/file/694554
http://www.blip.tv/file/633250/
http://blip.tv/file/627723
http://www.blip.tv/file/1462979/
http://blip.tv/file/582933
http://blip.tv/file/615671
http://video.google.com/videoplay?docid=7886780711843120756
http://video.google.com/videoplay?docid=5456752353400414374&q=obama&total=60521&start=0&num=50&so=0&type=search&plindex=5
http://video.google.com/videoplay?docid=6168784043164674382&hl=en
http://video.google.com/videoplay?docid=-3278279264905207761&q=obama's+religion
http://video.google.com/videoplay?docid=-1523532521779770523
http://video.google.com/videoplay?docid=-1241196528638897986
http://revver.com/video/1384702/cute-little-girl-runs-for-senate/
http://www.revver.com/video/929362/clinton-wants-obamas-superdelegates/
http://revver.com/video/783343/cedric-the-entertainer-slams-hillary-clinton/
http://revver.com/video/949461/barack-obama-as-jimmy-carter/
http://revver.com/video/1906726/obama-school-speech-video/
http://revver.com/video/1309658/election-news-obama-is-president-elect/
http://revver.com/video/348850/goodnight-burbank-breaking-news-obama-girl/
http://revver.com/video/1130010/cnns-obamamccain-coverage-and-the-psychological-influence/
http://video.yahoo.com/watch/1837362/6042753
http://video.yahoo.com/watch/2001251/6403820
http://video.yahoo.com/watch/3018138/8615647
http://video.yahoo.com/watch/3898026/10614284
http://video.yahoo.com/watch/1814640/5986532
http://video.yahoo.com/watch/1842402/6050969
http://video.yahoo.com/watch/3695324/10167879
http://video.yahoo.com/watch/3695192/10167611
http://video.yahoo.com/watch/3847185/10500944
http://video.yahoo.com/watch/4328841/11625131
http://www.viddler.com/explore/livingonplanet/videos/28/
http://www.viddler.com/explore/livingonplanet/videos/22/
http://www.viddler.com/explore/uptakevideo/videos/185/
http://www.viddler.com/explore/livingonplanet/videos/10/
http://www.viddler.com/explore/livingonplanet/videos/27/
http://www.viddler.com/explore/livingonplanet/videos/23/
http://www.viddler.com/explore/afteramerica/videos/2/
http://www.viddler.com/explore/livingonplanet/videos/25/
http://www.viddler.com/explore/PSUonDemand/videos/23/
http://www.viddler.com/explore/uptakevideo/videos/485/
http://www.liveleak.com/view?i=93e_1240769844&to_friend=1
http://www.liveleak.com/view?i=d99_1218407868&c=1
http://www.liveleak.com/view?i=b5c_1234883033&to_friend=1
http://www.liveleak.com/view?i=6ec_1233450381&to_friend=1
http://www.liveleak.com/view?i=aa4_1221263725&c=1
http://www.liveleak.com/view?i=fe9_1258556519&comment_order=newest_first
http://www.liveleak.com/view?i=4b1_1266254730&c=1
http://www.liveleak.com/view?i=7da_1252608881&c=1
http://animoto.com/play/5S3XFwUykFaObgyBdJIiAg
http://animoto.com/play/zmRlSGSSTAbO6WydGkpEvA
http://animoto.com/play/Dfh2eunX70woCziIfgbbQg
http://animoto.com/play/wNgouOCIt0cPOq7VupV0gg
http://animoto.com/play/1rCfLNUyBnUhlkV69PPbBQ
http://animoto.com/play/9a6ESTlt92FUZD0bJCi7bg?autostart=true
http://animoto.com/play/bRpUQU99aHlIUQBZ07Fy4Q
http://animoto.com/play/F50OCH5JDHB4UdUCywVL5Q
http://animoto.com/play/OSOKHw9iswLR3WQltQC1Cw?autostart=true
http://dotsub.com/view/bc80191a-bc10-4f77-bc8b-38109cf6b03b
http://dotsub.com/view/search/?q=Obama&page=5
http://dotsub.com/view/bc80191a-bc10-4f77-bc8b-38109cf6b03b/viewTranscript/eng
http://dotsub.com/view/eb67c6fa-502e-41c7-841a-ea299389b320
http://dotsub.com/view/cfad3ce8-8b80-4981-ba6b-f48f184d6712/viewTranscript/eng
http://dotsub.com/view/cd39ee4d-9a74-4f7b-aa15-dc0465e03242
http://dotsub.com/view/cfad3ce8-8b80-4981-ba6b-f48f184d6712
http://dotsub.com/view/472e8cf0-9605-4490-a6b8-142309bb9598
http://dotsub.com/view/e7d724d9-cafb-4052-b1cc-e9df8955f212
http://dotsub.com/view/search/rss/Obama
http://soundcloud.com/the-erratic-ninja/housin-obama
http://soundcloud.com/dj-paul-v/dj-paul-v-obama-megamix
http://soundcloud.com/shawn-mitchell-show/perverted-priorities-obama-one-year-later
http://soundcloud.com/shawn-mitchell-show
http://soundcloud.com/w-i-e/obama-w-i-e-remix
http://soundcloud.com/dmackdaddy/cancion-obama
http://soundcloud.com/adamsieff/04-obama
http://soundcloud.com/elvisofdallas/obama-calls-kanye-a-jackass-1/comment-465945
http://soundcloud.com/soulofsydney/change-makes-you-want-to-hustle-a-funk-soul-disco-tribute-to-barack-obama/comment-766963
http://soundcloud.com/dufrain/bariq-obama
http://www.hulu.com/watch?content_id=19700036
http://www.hulu.com/watch?content_id=17852057
http://www.hulu.com/watch?content_id=20266154
http://www.hulu.com/watch?content_id=18297909
http://www.hulu.com/watch?content_id=19885599
http://www.hulu.com/watch/135729/the-obama-administration-barack-obama-closer-in-chief
http://www.hulu.com/watch?content_id=50004522
http://www.hulu.com/watch/130479/the-obama-administration-does-the-white-house-have-a-communication-problem
http://www.hulu.com/watch/127750/the-obama-administration-white-house-duped-by-reid
http://www.hulu.com/watch/126377/the-obama-administration-schultz-to-dems-toughen-up?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+HuluRecentlyAddedVideos+(Hulu+-+Recently+added+videos)#http:%2F%2Fwww.hulu.com%2Ffeed%2Frecent%2Fvideos?rd=0
http://crackle.com/c/Funny/Obama_s_Vlog/2404799
http://crackle.com/c/Short_Films/The_Predicted_Obama/2392868
http://crackle.com/c/Funny/Hillary_or_Obama_/2041070
http://crackle.com/c/Animation/Obama_and_Iran/2410717
http://crackle.com/c/Political/Obama_Delegate/2251733
http://crackle.com/c/Standup/Funny_Obama/2228489
http://crackle.com/c/Wet_Paint/Funny_Obama/2228505
http://crackle.com/c/Animation/Obama_and_al_Qaeda/2409232
http://www.fancast.com/tv/Barack-Obama/101845/1144484662/Lessons-Of-D-Day/videos
http://www.fancast.com/tv/Barack-Obama/101845/1204270572/GOP-Mobs-Disrupt-Town-Halls/videos
http://www.fancast.com/tv/Barack-Obama/101845/1000190481/Congress-Backs-Obama-with-$825-Billion-Stimulus-Bill/videos
http://www.fancast.com/tv/Barack-Obama/101845/1212179023/Obama-Sells-Health-Care/videos
http://www.fancast.com/tv/Barack-Obama/101845/1340965634/Obama-Welcomes-India-P.M./videos
http://www.fancast.com/tv/Barack-Obama/101845/1349406421/Defending-Obama%E2%80%99s-War-Strategy/videos
http://www.fancast.com/tv/Barack-Obama/101845/1246238428/Greer-on-Obama%E2%80%99s-Education-Speech/videos
http://www.fancast.com/tv/Barack-Obama/101845/1306602366/Jarrett:-U.S.--Ready--for-Health-Reform/videos
http://www.fancast.com/tv/Barack-Obama/101845/1250047340/Boehner-reacts-to-Obama%E2%80%99s-speech/videos
http://www.fancast.com/tv/Barack-Obama/101845/1451681618/Obama-Continues-to-Sell-Reform/videos
http://www.funnyordie.com/videos/18da506b8a/obama-reacts-to-healthcare-vote
http://www.funnyordie.com/videos/3455b6fc40/the-prank-that-helped-presidentelect-obama-win-from-joshsomething
http://www.funnyordie.com/videos/f40ef6d351/obama-reads-bush-s-letter
http://www.funnyordie.com/videos/4f6b704c0e/obama-brings-sexy-back-from-chupacabra-the-series
http://www.funnyordie.com/videos/c43c5532bc/kkk-endorses-obama-from-paulbryant6
http://vimeo.com/7474626
http://www.vimeo.com/5003244
http://vimeo.com/2129435
http://vimeo.com/2129731
http://www.vimeo.com/7436890
http://www.vimeo.com/2101701
http://www.vimeo.com/1918487
http://vimeo.com/6072100
http://vimeo.com/6787024
http://www.vimeo.com/5342151
http://www.ted.com/talks/nate_silver_on_race_and_politics.html
http://www.ted.com/talks/clay_shirky_how_cellphones_twitter_facebook_can_make_history.html
http://www.ted.com/talks/michelle_obama.html
http://www.ted.com/talks/barry_schwartz_on_our_loss_of_wisdom.html
http://www.ted.com/talks/lang/spa/michelle_obama.html
http://www.omnisio.com/v/7H6BHShdjhG/clinton-and-obama-policy-debates
http://www.omnisio.com/v/AIEVH81djhG/obama-and-rev-wright
http://omnisio.com/v/LI2LfTUdjhG/better
http://omnisio.com/v/MfvjDVNdjhG/obama-introduction
http://omnisio.com/v/bWNTzVidjhG/exclusive-michael-j-fox-talks-to-katie-couric-re-rush-l
http://www.omnisio.com/v/vH7qrTLdjhG/michelle-obama-speaks-at-nc-state
http://www.thedailyshow.com/watch/tue-august-26-2008/indecision-2008---michelle-obama-s-patriotism
http://www.thedailyshow.com/watch/wed-october-29-2008/barack-obama
http://www.thedailyshow.com/watch/tue-january-20-2009/changefest--09---obama-s-inaugural-speech
http://www.thedailyshow.com/watch/tue-july-22-2008/obama-quest---bethlehem?videoId=177349
http://www.thedailyshow.com/watch/wed-june-11-2008/obama-s-car-commercial
http://www.thedailyshow.com/watch/wed-october-8-2008/michelle-obama-pt--2
http://www.thedailyshow.com/watch/wed-october-8-2008/michelle-obama-pt--1
http://www.thedailyshow.com/watch/thu-july-24-2008/obama-quest---berlin-speech
http://www.thedailyshow.com/watch/mon-april-21-2008/barack-obama-pt--2
http://www.colbertnation.com/the-colbert-report-videos/173313/june-11-2008/un-american-news---u-s--election-edition
http://www.colbertnation.com/the-colbert-report-videos/216606/january-22-2009/un-american-news---president-obama-edition
http://www.colbertnation.com/the-colbert-report-videos/166776/april-22-2008/obama-copycattery
http://www.colbertnation.com/the-colbert-report-videos/165954/april-15-2008/the-word---tradition
http://www.colbertnation.com/the-colbert-report-videos/174866/june-23-2008/tip-wag---barack-obama
http://www.colbertnation.com/the-colbert-report-videos/209942/november-06-2008/un-american-news---obama-edition
http://www.colbertnation.com/the-colbert-report-videos/252138/october-12-2009/war-of-peace---shashi-tharoor
http://www.colbertnation.com/the-colbert-report-videos/189700/october-29-2008/the-word---i-endorse-barack-obama
http://www.comedycentral.com/videos/index.jhtml?videoId=168815&title=carlos-mencia-barack-obama
http://www.comedycentral.com/videos/index.jhtml?videoId=186920&title=politibits-pete-lee-obamas-vice
http://www.comedycentral.com/videos/index.jhtml?videoId=209899&title=who-made-obama-win
http://www.comedycentral.com/videos/index.jhtml?videoId=226113&title=obamas-first-100-days
http://www.comedycentral.com/videos/index.jhtml?videoId=210463&title=barack-obamas-wardrobe
http://wordpress.tv/2009/10/27/matt-mullenweg-wordpress-open-source/
http://www.traileraddict.com/trailer/by-the-people-election-barack-obama/trailer
http://post.ly/aZxr
http://post.ly/aZMt
http://post.ly/aZQ3
http://post.ly/aZ3r
http://post.ly/aZ03
http://post.ly/aYt2
http://post.ly/aYfC
http://post.ly/aYdB
http://post.ly/aYct
http://post.ly/aQKz
http://post.ly/aYZP
http://post.ly/aXVi
http://post.ly/aYQo
http://post.ly/aYCi
http://post.ly/aY20
http://vimeo.com/10825843
http://vimeo.com/7761373
http://vimeo.com/10551565
http://vimeo.com/10780873
http://vimeo.com/5324878
http://vimeo.com/10923660
http://vimeo.com/10404839
http://vimeo.com/8991556
http://vimeo.com/10716289
http://vimeo.com/10928833
http://vimeo.com/10928964
http://vimeo.com/8332956
http://vimeo.com/10920478
http://vimeo.com/10228447
http://vimeo.com/9873910
http://vimeo.com/7817799
http://www.vimeo.com/10926023
http://vimeo.com/10721651
http://vimeo.com/10800426
http://www.funnyordie.com/videos/b8fa781c42/shotgun-harley-with-jason-jones
http://www.funnyordie.com/videos/d47751f7a0/raaaaaaaandy-declares-war-on-justin-bieber?rel=player
http://www.funnyordie.com/videos/22103dea0f/rammstein-vs-cookie-monster
http://www.funnyordie.com/videos/503ba0f6de/justin-bieber-in-concert?rel=auto_related&
http://www.funnyordie.com/videos/a264602741/bieber-takes-a-tumble?rel=player
http://tweetphoto.com/18499366
http://tweetphoto.com/18499269
http://tweetphoto.com/18499056
http://tweetphoto.com/18498703
http://tweetphoto.com/18498702
http://tweetphoto.com/18492753
http://tweetphoto.com/18493065
http://tweetphoto.com/18497851
http://tweetphoto.com/18498472
http://tweetphoto.com/18498590
http://tweetphoto.com/18497975
http://tweetphoto.com/18498580
http://tweetphoto.com/18498577
http://tweetphoto.com/18498465
http://tweetphoto.com/18498205
http://tweetphoto.com/18496285
http://tweetphoto.com/18497752
http://tweetphoto.com/18497047
http://tweetphoto.com/18496874
http://tweetphoto.com/18496787
http://tweetphoto.com/18496841
http://tweetphoto.com/18496836
http://tweetphoto.com/16446822
http://tweetphoto.com/18496709
http://tweetphoto.com/18496710
http://tweetphoto.com/18278792
http://tweetphoto.com/18496218
http://tweetphoto.com/18494660
http://tweetphoto.com/18496385
http://tweetphoto.com/18496384
http://www.youtube.com/watch?v=JGupbO3SfzI
http://www.youtube.com/watch?v=MZUSrR5TQkI
http://www.youtube.com/watch?v=3jR7b6SQWR8
http://www.youtube.com/watch?v=DFpn21dVXrw
http://www.youtube.com/watch?v=74T1UjLW8KE
http://www.youtube.com/watch?v=5Du9iN99WKU
http://www.youtube.com/watch?v=2_Ig0ClYlmM
http://www.youtube.com/watch?v=6BiH8jmNQzw
http://www.youtube.com/watch?v=4CGgaggeQgA
http://www.youtube.com/watch?v=z86yr0wQtiQ&
http://www.youtube.com/watch?v=yKnF2xepHV0
http://www.youtube.com/watch?v=EXUN8o6yHJU
http://www.youtube.com/watch?v=6jgouieelbk
http://www.youtube.com/watch?v=SrgRYdFsWcU
http://www.youtube.com/watch?v=KTQ1scE4k1k
http://www.youtube.com/watch?v=iYmmh9zkpQM&
http://www.youtube.com/watch?v=blOrY-nEGaE
http://www.flickr.com/photos/anniemaree/4522364649/
http://www.flickr.com/photos/49266919@N02/4522759998/
http://www.flickr.com/photos/49229844@N03/4515485892/
http://www.flickr.com/photos/49299121@N05/4520968839/
http://www.flickr.com/photos/7203091@N08/4521061753/
http://www.flickr.com/photos/26162566@N02/4517466619/
http://www.flickr.com/photos/kristjanfreyr/4479155519/sizes/o/
http://www.flickr.com/photos/blackbeltjones/4522972990/
http://www.flickr.com/photos/mapgoblin/4486538947/
http://www.amazon.com/dp/B003CN5B6K
http://www.amazon.com/dp/B002ZCY7PU
http://www.amazon.com/dp/B002ZCY7QY
http://www.amazon.com/dp/B003FHC5NU
http://www.amazon.com/Wordcatcher-Odyssey-World-Weird-Wonderful/dp/1573444006
http://www.funnyordie.com/videos/b8fa781c42/shotgun-harley-with-jason-jones
http://www.funnyordie.com/videos/d47751f7a0/raaaaaaaandy-declares-war-on-justin-bieber?rel=player
http://www.funnyordie.com/videos/22103dea0f/rammstein-vs-cookie-monster
http://www.funnyordie.com/videos/503ba0f6de/justin-bieber-in-concert?rel=auto_related&
http://www.funnyordie.com/videos/a264602741/bieber-takes-a-tumble?rel=player
http://www.collegehumor.com/video:1909386
http://www.collegehumor.com/video:1932163
http://www.collegehumor.com/video:1932083
http://www.collegehumor.com/video:1922981
http://www.collegehumor.com/video:1932171
http://www.collegehumor.com/video:1932964
http://www.collegehumor.com/video:1771556
http://www.collegehumor.com/video:1932811
http://www.collegehumor.com/video:1932809
http://www.collegehumor.com/video:1932180
http://www.collegehumor.com/video:1932943
http://www.collegehumor.com/video:1924838
http://www.collegehumor.com/video:1932918
http://www.collegehumor.com/video:1931876
http://www.collegehumor.com/video:1924727
http://www.collegehumor.com/video:1924064
http://www.collegehumor.com/video:1932942
http://www.collegehumor.com/video:1931515
http://www.collegehumor.com/video:1931028
http://www.collegehumor.com/video:1908741
http://www.hulu.com/watch/45644/its-always-sunny-in-philadelphia-the-nightman-cometh
http://www.hulu.com/watch/142123/glee-vogue
http://www.hulu.com/watch/142227/parenthood-rubber-band-ball#s-p1-sr-i1
http://www.hulu.com/watch/141556/saturday-night-live-teacher
http://www.hulu.com/watch/142281/late-night-with-jimmy-fallon-exclusive-performance-the-specials
http://www.hulu.com/watch/18138/the-simpsons-tax-day
http://bit.ly/aT9B9q
http://bit.ly/9u4UTt
http://bit.ly/afPLDi
http://bit.ly/bRVyh2
http://bit.ly/bzeGnh
http://bit.ly/9EtGAC
http://bit.ly/cGbfTj
http://www.justin.tv/twitterchirp#r=vu9A84A~&
http://justin.tv/s/04/KQhCHR4~/radiolamejoram
http://justin.tv/s/01/NnaHvRw/stylesomega
http://justin.tv/s/01/KQhCHR4/radiolamejoram
http://justin.tv/s/01/KQhCHR4/ilformal
http://www.justin.tv/channel3#r=hxqwQTE~&
http://www.justin.tv/teamenvyus
http://www.justin.tv/twitterchirp/b/262242477
http://crackle.com/c/The_Blob/The_Blob/2481060
http://crackle.com/c/Barney_Miller
http://www.crackle.com/c/The_Bannen_Way
http://crackle.com/c/The_Blob
http://crackle.com/c/Star-ving
http://www.crackle.com/c/star-ving
http://www.fancast.com/tv/Star-Trek/96413/620862403/Star-Trek%3A-The-Original-Series---Return-to-Tomorrow/videos
http://www.fancast.com/tv/Glee/103049/1467994754/Vogue/videos
http://bit.ly/9XGjeL
http://bit.ly/begEF2
http://bit.ly/a1ZWRP
http://bit.ly/ciFUEx
http://bit.ly/9x2ocN
http://bit.ly/8KZpL2
http://bit.ly/cxgVJs
http://bit.ly/9jcHCw
http://bit.ly/cZnxwZ
http://bit.ly/cXaiyc
http://bit.ly/78WXz8
http://www.slideshare.net/rascorpion/segmenting-targetting-for-obama-campaign-presentation
http://www.slideshare.net/jhcordeiro/aprendendo-com-obama-learning-from-obama
http://www.slideshare.net/evon1001c/eco-obama-yes-we-can
http://www.slideshare.net/goldenbook/ronald-reagan-oligarchy-pg-1-53-barack-hussein-obama-warning-001-strategy-structure-society-separation-supremacy-intertwined-intimidation-inevitable-conflict-by-gregory-bodenhamer-mechanicsburg-pa-all-rights-reserved-2009
http://www.slideshare.net/Donniefranklin/The-Obama-Strategy
http://www.slideshare.net/rmuslim1978/obama-surge
http://www.slideshare.net/apscuhuru/can-barack-obama-really-bring-the-change-we-need-presentation-630816
http://www.slideshare.net/carolynallen/obama-100-days-pt1-presentation
http://www.slideshare.net/leonwitt/obama-case-by-socialmedia8
http://www.scribd.com/doc/16097258/The-Social-Media-Use-of-Obama-and-McCain
http://www.scribd.com/doc/6095094/Barack-Hussein-Obamas-Stealth-Socialism
http://www.scribd.com/doc/6464528/Obama-Radical
http://www.scribd.com/doc/7660387/Obamas-Socialism-for-Dummies
http://www.scribd.com/doc/7539456/Hussein-Obama-Psychopath
http://www.scribd.com/doc/28654563/Reasons-to-Impeach-Obama
http://www.scribd.com/doc/11481884/Obama
http://www.scribd.com/doc/13984347/OBAMAchangeorWhat09
http://www.scribd.com/doc/4773699/Obama-Nation-Unfit-for-Publication
http://www.scribd.com/doc/19813078/Obama-Acorn-Could-It-Be-True
http://screenr.com/XFU
http://screenr.com/xzH
http://screenr.com/8BM
http://screenr.com/ELB
http://screenr.com/Wdg
http://screenr.com/09B
http://screenr.com/kb2
http://screenr.com/ffH
http://screenr.com/o2x
http://screenr.com/nF8
http://www.5min.com/Video/Obama-Wants-Tax-on-Banks-259812154
http://www.5min.com/Video/3-Reasons-Why-Obamas-High-Speed-Rail-Will-Go-Nowhere-Fast-265821223
http://www.5min.com/Video/Obamas-Financial-Overhaul-259791853
http://www.5min.com/Video/Obama-on-Housing-259806854
http://www.5min.com/Video/Facts-About-Barack-Obama-Part-2-112437815
http://www.5min.com/Video/Barack-Obama---Profile-171008518
http://www.howcast.com/videos/99965-Rebooting-Politics-20-With-the-Obama-Campaigns-New-Media-Team-Part-1-Of-4
http://www.howcast.com/videos/99968-Rebooting-Politics-20-With-the-Obama-Campaigns-New-Media-Team-Part-3-Of-4
http://www.howcast.com/videos/71601-Obama-Wins-How-Does-It-Impact-Your-IRS-Problem
http://www.howcast.com/videos/37649-Obama-and-McCain-Agree-FREE-ISRAEL-FandK-PALESTINE
http://www.howcast.com/videos/99970-Rebooting-Politics-20-With-the-Obama-Campaigns-New-Media-Team-Part-4-Of-4
http://www.howcast.com/videos/99967-Rebooting-Politics-20-With-the-Obama-Campaigns-New-Media-Team-Part-2-Of-4
ruby-oembed-0.8.14/spec/ 0000755 0000041 0000041 00000000000 12546055651 015011 5 ustar www-data www-data ruby-oembed-0.8.14/spec/provider_discovery_spec.rb 0000644 0000041 0000041 00000007715 12546055651 022303 0 ustar www-data www-data require File.dirname(__FILE__) + '/spec_helper'
require 'vcr'
VCR.config do |c|
c.default_cassette_options = { :record => :new_episodes }
c.cassette_library_dir = 'spec/cassettes'
c.stub_with :fakeweb
end
describe OEmbed::ProviderDiscovery do
before(:all) do
VCR.insert_cassette('OEmbed_ProviderDiscovery')
end
after(:all) do
VCR.eject_cassette
end
include OEmbedSpecHelper
{
'youtube' => [
'http://www.youtube.com/watch?v=u6XAPnuFjJc',
'http://www.youtube.com/oembed',
:json,
],
'vimeo' => [
'http://vimeo.com/27953845',
{:json=>'http://vimeo.com/api/oembed.json',:xml=>'http://vimeo.com/api/oembed.xml'},
:json,
],
#'noteflight' => [
# 'http://www.noteflight.com/scores/view/09665392c94475f65dfaf5f30aadb6ed0921939d',
# 'http://www.noteflight.com/services/oembed',
# :json,
#],
#'wordpress' => [
# 'http://sweetandweak.wordpress.com/2011/09/23/nothing-starts-the-morning-like-a-good-dose-of-panic/',
# 'http://public-api.wordpress.com/oembed/1.0/',
# :json,
#],
}.each do |context, urls|
given_url, expected_endpoint, expected_format = urls
context "with #{context} url" do
describe "discover_provider" do
before(:all) do
@provider_default = OEmbed::ProviderDiscovery.discover_provider(given_url)
@provider_json = OEmbed::ProviderDiscovery.discover_provider(given_url, :format=>:json)
@provider_xml = OEmbed::ProviderDiscovery.discover_provider(given_url, :format=>:xml)
end
it "should return the correct Class" do
expect(@provider_default).to be_instance_of(OEmbed::Provider)
expect(@provider_json).to be_instance_of(OEmbed::Provider)
expect(@provider_xml).to be_instance_of(OEmbed::Provider)
end
it "should detect the correct URL" do
if expected_endpoint.is_a?(Hash)
expect(@provider_json.endpoint).to eq(expected_endpoint[expected_format])
expect(@provider_json.endpoint).to eq(expected_endpoint[:json])
expect(@provider_xml.endpoint).to eq(expected_endpoint[:xml])
else
expect(@provider_default.endpoint).to eq(expected_endpoint)
expect(@provider_json.endpoint).to eq(expected_endpoint)
expect(@provider_xml.endpoint).to eq(expected_endpoint)
end
end
it "should return the correct format" do
expect(@provider_default.format).to eq(expected_format)
expect(@provider_json.format).to eq(:json)
expect(@provider_xml.format).to eq(:xml)
end
end # discover_provider
describe "get" do
before(:all) do
@response_default = OEmbed::ProviderDiscovery.get(given_url)
@response_json = OEmbed::ProviderDiscovery.get(given_url, :format=>:json)
@response_xml = OEmbed::ProviderDiscovery.get(given_url, :format=>:xml)
end
it "should return the correct Class" do
expect(@response_default).to be_kind_of(OEmbed::Response)
expect(@response_json).to be_kind_of(OEmbed::Response)
expect(@response_xml).to be_kind_of(OEmbed::Response)
end
it "should return the correct format" do
expect(@response_default.format).to eq(expected_format.to_s)
expect(@response_json.format).to eq('json')
expect(@response_xml.format).to eq('xml')
end
it "should return the correct data" do
expect(@response_default.type).to_not be_nil
expect(@response_json.type).to_not be_nil
expect(@response_xml.type).to_not be_nil
# Technically, the following values _could_ be blank, but for the
# examples urls we're using we expect them not to be.
expect(@response_default.title).to_not be_nil
expect(@response_json.title).to_not be_nil
expect(@response_xml.title).to_not be_nil
end
end # get
end
end # each service
end ruby-oembed-0.8.14/spec/formatter/ 0000755 0000041 0000041 00000000000 12546055651 017014 5 ustar www-data www-data ruby-oembed-0.8.14/spec/formatter/xml/ 0000755 0000041 0000041 00000000000 12546055651 017614 5 ustar www-data www-data ruby-oembed-0.8.14/spec/formatter/xml/rexml_backend_spec.rb 0000644 0000041 0000041 00000003572 12546055651 023760 0 ustar www-data www-data require File.dirname(__FILE__) + '/../../spec_helper'
describe "OEmbed::Formatter::XML::Backends::REXML" do
include OEmbedSpecHelper
before(:all) do
expect {
OEmbed::Formatter::XML.backend = 'REXML'
}.to_not raise_error
expect((!!defined?(REXML))).to eq(true)
end
it "should support XML" do
expect {
OEmbed::Formatter.supported?(:xml)
}.to_not raise_error
end
it "should be using the XmlSimple backend" do
expect(OEmbed::Formatter::XML.backend).to eq(OEmbed::Formatter::XML::Backends::REXML)
end
it "should decode an XML String" do
decoded = OEmbed::Formatter.decode(:xml, valid_response(:xml))
# We need to compare keys & values separately because we don't expect all
# non-string values to be recognized correctly.
expect(decoded.keys).to eq(valid_response(:object).keys)
expect(decoded.values.map{|v|v.to_s}).to eq(valid_response(:object).values.map{|v|v.to_s})
end
it "should raise an OEmbed::ParseError when decoding an invalid XML String" do
expect {
decode = OEmbed::Formatter.decode(:xml, invalid_response('unclosed_container', :xml))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:xml, invalid_response('unclosed_tag', :xml))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:xml, invalid_response('invalid_syntax', :xml))
}.to raise_error(OEmbed::ParseError)
end
it "should raise an OEmbed::ParseError when decoding fails with an unexpected error" do
error_to_raise = ArgumentError
expect(OEmbed::Formatter::XML.backend.parse_error).to_not be_kind_of(error_to_raise)
expect(::REXML::Document).to receive(:new).
and_raise(error_to_raise.new("unknown error"))
expect {
decode = OEmbed::Formatter.decode(:xml, valid_response(:xml))
}.to raise_error(OEmbed::ParseError)
end
end ruby-oembed-0.8.14/spec/formatter/xml/nokogiri_backend_spec.rb 0000644 0000041 0000041 00000003727 12546055651 024454 0 ustar www-data www-data require File.dirname(__FILE__) + '/../../spec_helper'
describe "OEmbed::Formatter::XML::Backends::Nokogiri" do
include OEmbedSpecHelper
before(:all) do
expect {
OEmbed::Formatter::XML.backend = 'Nokogiri'
}.to raise_error(LoadError)
require 'nokogiri'
expect {
OEmbed::Formatter::XML.backend = 'Nokogiri'
}.to_not raise_error
end
it "should support XML" do
expect {
OEmbed::Formatter.supported?(:xml)
}.to_not raise_error
end
it "should be using the Nokogiri backend" do
expect(OEmbed::Formatter::XML.backend).to eq(OEmbed::Formatter::XML::Backends::Nokogiri)
end
it "should decode an XML String" do
decoded = OEmbed::Formatter.decode(:xml, valid_response(:xml))
# We need to compare keys & values separately because we don't expect all
# non-string values to be recognized correctly.
expect(decoded.keys).to eq(valid_response(:object).keys)
expect(decoded.values.map{|v|v.to_s}).to eq(valid_response(:object).values.map{|v|v.to_s})
end
it "should raise an OEmbed::ParseError when decoding an invalid XML String" do
expect {
decode = OEmbed::Formatter.decode(:xml, invalid_response('unclosed_container', :xml))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:xml, invalid_response('unclosed_tag', :xml))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:xml, invalid_response('invalid_syntax', :xml))
}.to raise_error(OEmbed::ParseError)
end
it "should raise an OEmbed::ParseError when decoding fails with an unexpected error" do
error_to_raise = ArgumentError
expect(OEmbed::Formatter::XML.backend.parse_error).to_not be_kind_of(error_to_raise)
expect(::Nokogiri::XML::Document).to receive(:parse).
and_raise(error_to_raise.new("unknown error"))
expect {
decode = OEmbed::Formatter.decode(:xml, valid_response(:xml))
}.to raise_error(OEmbed::ParseError)
end
end ruby-oembed-0.8.14/spec/formatter/xml/xmlsimple_backend_spec.rb 0000644 0000041 0000041 00000003720 12546055651 024636 0 ustar www-data www-data require File.dirname(__FILE__) + '/../../spec_helper'
describe "OEmbed::Formatter::XML::Backends::XmlSimple" do
include OEmbedSpecHelper
before(:all) do
expect {
OEmbed::Formatter::XML.backend = 'XmlSimple'
}.to raise_error(LoadError)
require 'xmlsimple'
expect {
OEmbed::Formatter::XML.backend = 'XmlSimple'
}.to_not raise_error
end
it "should support XML" do
expect {
OEmbed::Formatter.supported?(:xml)
}.to_not raise_error
end
it "should be using the XmlSimple backend" do
expect(OEmbed::Formatter::XML.backend).to eq(OEmbed::Formatter::XML::Backends::XmlSimple)
end
it "should decode an XML String" do
decoded = OEmbed::Formatter.decode(:xml, valid_response(:xml))
# We need to compare keys & values separately because we don't expect all
# non-string values to be recognized correctly.
expect(decoded.keys).to eq(valid_response(:object).keys)
expect(decoded.values.map{|v|v.to_s}).to eq(valid_response(:object).values.map{|v|v.to_s})
end
it "should raise an OEmbed::ParseError when decoding an invalid XML String" do
expect {
decode = OEmbed::Formatter.decode(:xml, invalid_response('unclosed_container', :xml))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:xml, invalid_response('unclosed_tag', :xml))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:xml, invalid_response('invalid_syntax', :xml))
}.to raise_error(OEmbed::ParseError)
end
it "should raise an OEmbed::ParseError when decoding fails with an unexpected error" do
error_to_raise = ArgumentError
expect(OEmbed::Formatter::XML.backend.parse_error).to_not be_kind_of(error_to_raise)
expect(::XmlSimple).to receive(:xml_in).
and_raise(error_to_raise.new("unknown error"))
expect {
decode = OEmbed::Formatter.decode(:xml, valid_response(:xml))
}.to raise_error(OEmbed::ParseError)
end
end ruby-oembed-0.8.14/spec/formatter/ducktype_backend_spec.rb 0000644 0000041 0000041 00000005147 12546055651 023661 0 ustar www-data www-data require File.dirname(__FILE__) + '/../spec_helper'
class WorkingDuck
# The WorkingDuck Class should work as a Backend
class << self
# Fakes a correct deocde response
def decode(value)
{"version"=>1.0, "string"=>"test", "int"=>42, "html"=>"Cool's\n the \"word\"!",}
end
def parse_error; RuntimeError; end
end
# A WorkingDuck instance should work as a Backend
def decode(value)
self.class.decode(value)
end
def parse_error; RuntimeError; end
end
class FailingDuckDecode
# Fakes an incorrect decode response
def decode(value)
{}
end
def parse_error; RuntimeError; end
end
describe "OEmbed::Formatter::JSON::Backends::DuckType" do
include OEmbedSpecHelper
it "should work with WorkingDuck Class" do
expect {
OEmbed::Formatter::JSON.backend = WorkingDuck
}.not_to raise_error
expect(OEmbed::Formatter::JSON.backend).to be WorkingDuck
end
it "should work with a WorkingDuck instance" do
instance = WorkingDuck.new
expect {
OEmbed::Formatter::JSON.backend = instance
}.to_not raise_error
expect(OEmbed::Formatter::JSON.backend).to be instance
end
it "should fail with FailingDuckDecode Class" do
expect {
OEmbed::Formatter::JSON.backend = FailingDuckDecode
}.to raise_error(LoadError)
expect(OEmbed::Formatter::JSON.backend).to_not be(FailingDuckDecode)
end
it "should fail with a FailingDuckDecode instance" do
instance = FailingDuckDecode.new
expect {
OEmbed::Formatter::JSON.backend = instance
}.to raise_error(LoadError)
expect(OEmbed::Formatter::JSON.backend).to_not be(instance)
end
end
describe "OEmbed::Formatter::XML::Backends::DuckType" do
include OEmbedSpecHelper
it "should work with WorkingDuck Class" do
expect {
OEmbed::Formatter::XML.backend = WorkingDuck
}.to_not raise_error
expect(OEmbed::Formatter::XML.backend).to be(WorkingDuck)
end
it "should work with a WorkingDuck instance" do
instance = WorkingDuck.new
expect {
OEmbed::Formatter::XML.backend = instance
}.to_not raise_error
expect(OEmbed::Formatter::XML.backend).to be(instance)
end
it "should fail with FailingDuckDecode Class" do
expect {
OEmbed::Formatter::XML.backend = FailingDuckDecode
}.to raise_error(LoadError)
expect(OEmbed::Formatter::XML.backend).to_not be(FailingDuckDecode)
end
it "should fail with a FailingDuckDecode instance" do
instance = FailingDuckDecode.new
expect {
OEmbed::Formatter::XML.backend = instance
}.to raise_error(LoadError)
expect(OEmbed::Formatter::XML.backend).to_not be(instance)
end
end ruby-oembed-0.8.14/spec/formatter/json/ 0000755 0000041 0000041 00000000000 12546055651 017765 5 ustar www-data www-data ruby-oembed-0.8.14/spec/formatter/json/jsongem_backend_spec.rb 0000644 0000041 0000041 00000003716 12546055651 024444 0 ustar www-data www-data require File.dirname(__FILE__) + '/../../spec_helper'
describe "OEmbed::Formatter::JSON::Backends::JSONGem" do
include OEmbedSpecHelper
before(:all) do
expect {
OEmbed::Formatter::JSON.backend = 'JSONGem'
}.to raise_error(LoadError)
require 'json'
expect {
OEmbed::Formatter::JSON.backend = 'JSONGem'
}.to_not raise_error
end
it "should support JSON" do
expect {
OEmbed::Formatter.supported?(:json)
}.to_not raise_error
end
it "should be using the JSONGem backend" do
expect(OEmbed::Formatter::JSON.backend).to eq(OEmbed::Formatter::JSON::Backends::JSONGem)
end
it "should decode a JSON String" do
decoded = OEmbed::Formatter.decode(:json, valid_response(:json))
# We need to compare keys & values separately because we don't expect all
# non-string values to be recognized correctly.
expect(decoded.keys).to eq(valid_response(:object).keys)
expect(decoded.values.map{|v|v.to_s}).to eq(valid_response(:object).values.map{|v|v.to_s})
end
it "should raise an OEmbed::ParseError when decoding an invalid JSON String" do
expect {
decode = OEmbed::Formatter.decode(:json, invalid_response('unclosed_container', :json))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:json, invalid_response('unclosed_tag', :json))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:json, invalid_response('invalid_syntax', :json))
}.to raise_error(OEmbed::ParseError)
end
it "should raise an OEmbed::ParseError when decoding fails with an unexpected error" do
error_to_raise = ArgumentError
expect(OEmbed::Formatter::JSON.backend.parse_error).to_not be_kind_of(error_to_raise)
expect(::JSON).to receive(:parse).
and_throw(error_to_raise.new("unknown error"))
expect {
decode = OEmbed::Formatter.decode(:json, valid_response(:json))
}.to raise_error(OEmbed::ParseError)
end
end ruby-oembed-0.8.14/spec/formatter/json/.DS_Store 0000644 0000041 0000041 00000014004 12546055651 021447 0 ustar www-data www-data Bud1 % @ € @ € @ € @ E % DSDB ` € @ € @ € @ ruby-oembed-0.8.14/spec/formatter/json/yaml_backend_spec.rb 0000644 0000041 0000041 00000003640 12546055651 023740 0 ustar www-data www-data require File.dirname(__FILE__) + '/../../spec_helper'
describe "OEmbed::Formatter::JSON::Backends::Yaml" do
include OEmbedSpecHelper
before(:all) do
expect {
OEmbed::Formatter::JSON.backend = 'Yaml'
}.to_not raise_error
expect(!!defined?(YAML)).to eq(true)
end
it "should support JSON" do
expect {
OEmbed::Formatter.supported?(:json)
}.to_not raise_error
end
it "should be using the Yaml backend" do
expect(OEmbed::Formatter::JSON.backend).to eq(OEmbed::Formatter::JSON::Backends::Yaml)
end
it "should decode a JSON String" do
decoded = OEmbed::Formatter.decode(:json, valid_response(:json))
# We need to compare keys & values separately because we don't expect all
# non-string values to be recognized correctly.
expect(decoded.keys).to eq(valid_response(:object).keys)
expect(decoded.values.map{|v|v.to_s}).to eq(valid_response(:object).values.map{|v|v.to_s})
end
it "should raise an OEmbed::ParseError when decoding an invalid JSON String" do
expect {
decode = OEmbed::Formatter.decode(:json, invalid_response('unclosed_container', :json))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:json, invalid_response('unclosed_tag', :json))
}.to raise_error(OEmbed::ParseError)
expect {
decode = OEmbed::Formatter.decode(:json, invalid_response('invalid_syntax', :json))
}.to raise_error(OEmbed::ParseError)
end
it "should raise an OEmbed::ParseError when decoding fails with an unexpected error" do
error_to_raise = ArgumentError
expect(OEmbed::Formatter::JSON.backend.parse_error).to_not be_kind_of(error_to_raise)
expect(OEmbed::Formatter::JSON.backend).to receive(:convert_json_to_yaml).
and_throw(error_to_raise.new("unknown error"))
expect {
decode = OEmbed::Formatter.decode(:json, valid_response(:json))
}.to raise_error(OEmbed::ParseError)
end
end ruby-oembed-0.8.14/spec/spec_helper_examples.yml 0000644 0000041 0000041 00000005457 12546055651 021736 0 ustar www-data www-data ---
:flickr:
:url: "http://flickr.com/photos/bees/2362225867/"
:body: !
'{"version":"1.0","type":"photo","author_url":"http:\/\/www.flickr.com\/photos\/bees\/","cache_age":3600,"provider_name":"Flickr","provider_url":"http:\/\/www.flickr.com\/","title":"Bacon
Lollys","author_name":"\u202e\u202d\u202cbees\u202c","width":"500","height":"375","url":"http:\/\/farm4.staticflickr.com\/3040\/2362225867_4a87ab8baf.jpg"}
'
:skitch:
:url: "http://skitch.com/sethferreira/nmbr8/the-kings-new-toy"
:body: ! '{"type":"photo","version":"1.0","author_name":"sethferreira","author_url":"http:\/\/skitch.com\/sethferreira\/","provider_name":"Skitch.com","provider_url":"http:\/\/skitch.com\/","width":804,"height":804,"url":"https:\/\/img.skitch.com\/20091210-m9cq9r2e6cy1j1sn23acn38kx.jpg","thumbnail_width":337,"thumbnail_height":337,"thumbnail_url":"https:\/\/img.skitch.com\/20091210-m9cq9r2e6cy1j1sn23acn38kx.preview.jpg","cache_age":86400}'
:viddler:
:url: "http://www.viddler.com/explore/cdevroe/videos/424/"
:qik:
:url: "http://qik.com/video/49565"
:vimeo:
:url: "http://vimeo.com/3100878"
:body: ! '{"type":"video","version":"1.0","provider_name":"Vimeo","provider_url":"http:\/\/vimeo.com\/","title":"Murmuration","author_name":"Sophie
Windsor Clive","author_url":"http:\/\/vimeo.com\/user3069761","is_plus":"0","html":"