Difference between revisions of "Adding Embed Whitelist Items"

From Dreamwidth Notes
Jump to: navigation, search
(Example)
(blip.tv is dead and I'm tired of getting SEO spam mails about it)
 
(7 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
  cgi-bin/DW/Hooks/EmbedWhitelist.pm
 
  cgi-bin/DW/Hooks/EmbedWhitelist.pm
 
  t/embed-whitelist.t
 
  t/embed-whitelist.t
 +
 +
In the code hook, most sites can be added to <code>%host_path_match</code> with a simple regular expression to test that the URL is in the expected format.  The second argument is 1 or 0 depending on whether the site supports https connections or not - you should test this.
 +
 +
In the test suite, you'll want to add a simple check to make sure the URL you were given as a test case passes your check to be allowed on the site.  See [[Dev Testing]] for more information about setting up and running the automated tests.
  
  
Line 11: Line 15:
 
[https://github.com/dreamwidth/dw-free/pull/1680 Add vid.me embeds, cover the other type of flickr videos]
 
[https://github.com/dreamwidth/dw-free/pull/1680 Add vid.me embeds, cover the other type of flickr videos]
  
 +
== Current Whitelisted Embeds ( as of June 2018) ==
 +
 +
* [http://www.4shared.com 4Shared]
 +
* [http://www.8tracks.com 8Tracks]
 +
 +
* [http://airtable.com Airtable]
 +
* [http://www.archive.org Internet Archive]
 +
* [https://audiomack.com Audiomack]
 +
 +
* [http://www.bandcamp.com Bandcamp]
 +
* [http://www.box.com Box]
 +
 +
* [https://chirb.it chirb.it]
 +
* [http://cnn.com CNN]
 +
* [http://www.codepen.io Codepen]
 +
* [http://coub.com Coub]
 +
* [http://www.criticalcommons.org Critical Commons]
 +
 +
* [http://www.dailymotion.com DailyMotion]
 +
* [http://www.dotsub.com Dotsub]
 +
* [http://discordapp.com Discord]
 +
 +
* [http://www.episodecalendar.com Episode Calendar]
 +
 +
* [http://www.facebook.com Facebook]
 +
 +
* [http://www.flickr.com Flickr]
 +
* [http://funnyordie.com Funny or Die]
 +
 +
* [http://www.goodreads.com GoodReads]
 +
* [http://giphy.com Giphy]
 +
 +
* [http://www.google.com Google]
 +
* [http://maps.google.com Google Maps]
 +
* [http://calendar.google.com Google Calendar]
 +
* [http://docs.google.com Google Docs] (excluding forms, for security reasons)
 +
* [http://books.google.com Google Books]
 +
 +
* [http://www.imgur.com imgur]
 +
* [http://www.instagram.com Instagram]
 +
 +
* [http://www.jigsawplanet.com Jigsaw Planet]
 +
 +
* [http://jsfiddle.net JSFiddle]
 +
 +
* [http://www.kickstarter.com Kickstarter]
 +
 +
* [http://lichess.org lichess]
 +
* [http://livejournal.com LiveJournal]
 +
 +
* [http://www.mixcloud.com Mixcloud]
 +
* [https://mixstep.co Mixstep]
 +
* [http://www.msnbc.com MSNBC]
 +
* [http://my.mail.ru my.mail.ru]
 +
 +
* [http://www.nicovideo.jp NicoNico]
 +
* [http://noisetrade.com NoiseTrade]
 +
* [http://www.npr.org National Public Radio]
 +
 +
* [http://onedrive.live.com Microsoft OneDrive]
 +
 +
* [http://playmoss.com Playmoss]
 +
* [http://www.plurk.com Plurk]
 +
 +
* [http://www.sbs.com.au SBS]
 +
* [http://scratch.mit.edu Scratch - MIT]
 +
* [http://www.scribd.com Scribd]
 +
* [http://www.slideshare.com Slideshare]
 +
* [http://www.soundcloud.com SoundCloud]
 +
* [http://www.spotify.com Spotify]
 +
 +
* [http://www.ted.com TED Talks]
 +
 +
* [http://www.vid.me vid.me]
 +
* [http://www.vimeo.com Vimeo]
 +
* [http://www.vine.co Vine]
 +
* [http://vk.com VK]
 +
 +
* [http://fast.wistia.com Wistia]
 +
 +
* [http://commons.wikimedia.org Wikimedia Commons]
 +
 +
* [http://www.yahoo.com Yahoo!]
 +
 +
* [http://www.yandex.ru Yandex]
 +
* [http://music.yandex.ru Yandex Music]
 +
 +
* [http://www.youtube.com YouTube]
 +
 +
* [http://www.zippcast.com Zippcast]
  
 
[[Category: Development]]
 
[[Category: Development]]

Latest revision as of 19:18, 8 September 2023

Files you'll want to poke include:

cgi-bin/DW/Hooks/EmbedWhitelist.pm
t/embed-whitelist.t

In the code hook, most sites can be added to %host_path_match with a simple regular expression to test that the URL is in the expected format. The second argument is 1 or 0 depending on whether the site supports https connections or not - you should test this.

In the test suite, you'll want to add a simple check to make sure the URL you were given as a test case passes your check to be allowed on the site. See Dev Testing for more information about setting up and running the automated tests.


Example

Add flickr embeds to our whitelist, issue #720

Add vid.me embeds, cover the other type of flickr videos

Current Whitelisted Embeds ( as of June 2018)