diff --git a/index.coffee b/index.coffee index 5020311..b35627c 100644 --- a/index.coffee +++ b/index.coffee @@ -397,6 +397,10 @@ module.exports = class Flatten return 'video' if parsed.hostname.indexOf('livestream.com') isnt -1 return 'audio' if parsed.hostname.indexOf('soundcloud.com') isnt -1 return 'audio' if parsed.hostname.indexOf('bandcamp.com') isnt -1 + return 'interactive' if parsed.hostname.indexOf('maps.google.') isnt -1 and parsed.pathname.indexOf('/directions') isnt -1 + return 'interactive' if parsed.hostname.indexOf('www.google.com') isnt -1 and parsed.pathname.indexOf('/directions') isnt -1 + return 'interactive' if parsed.hostname.indexOf('maps.google.') isnt -1 and parsed.query?.mid? + return 'interactive' if parsed.hostname.indexOf('www.google.com') isnt -1 and parsed.query?.mid? return 'location' if parsed.hostname.indexOf('maps.google.') isnt -1 return 'location' if parsed.hostname.indexOf('www.google.com') isnt -1 and parsed.pathname.indexOf('/maps') isnt -1 diff --git a/spec/Flatten.coffee b/spec/Flatten.coffee index 53b7c43..db9015f 100644 --- a/spec/Flatten.coffee +++ b/spec/Flatten.coffee @@ -105,7 +105,7 @@ describe 'Flatten', -> chai.expect(data).to.deep.eql expected done() - it 'should be able to find Embed.ly videos and audios', (done) -> + it 'should be able to find Embed.ly media', (done) -> if console.timeEnd console.time 'flattening HTML structures' sent = @@ -121,6 +121,8 @@ describe 'Flatten', -> + + """ ] @@ -158,6 +160,12 @@ describe 'Flatten', -> type: 'video' video: '//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fi.imgur.com%2FaK4RY7D.mp4&src_secure=1&url=http%3A%2F%2Fi.imgur.com%2FaK4RY7D.gifv&image=http%3A%2F%2Fi.imgur.com%2FaK4RY7D.gif%3Fnoredirect&key=b7d04c9b404c499eba89ee7072e1c4f7&type=video%2Fmp4&schema=imgur' html: '' + , + type: 'interactive' + html: "" + , + type: 'interactive' + html: "" ] ]