diff --git a/index.coffee b/index.coffee index 5a8bf0c..a5034de 100644 --- a/index.coffee +++ b/index.coffee @@ -414,6 +414,10 @@ module.exports = class Flatten return 'video' if parsed.hostname.indexOf('giphy.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 9c26be5..b50cf26 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 = @@ -122,6 +122,8 @@ describe 'Flatten', -> + + """ ] @@ -163,6 +165,12 @@ describe 'Flatten', -> type: 'video' video: '//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FsRm0Q3hirbSX6%2Ftwitter%2Fiframe&src_secure=1&url=http%3A%2F%2Fgiphy.com%2Fgifs%2FsRm0Q3hirbSX6&image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FsRm0Q3hirbSX6%2Fgiphy.gif&key=internal&type=text%2Fhtml&schema=giphy' html: "" + , + type: 'interactive' + html: "" + , + type: 'interactive' + html: "" ] ]