fossasia/loklak_webclient

View on GitHub
iframely/plugins/domains/i.giphy.com.js

Summary

Maintainability
A
0 mins
Test Coverage
module.exports = {

    re: [
        /https?:\/\/i\.giphy\.com\/(\w+)\.gif(\?.*)?$/i,
        /https?:\/\/media\d?\.giphy\.com\/media\/(\w+)\/(?:giphy|\d+)\.gif$/i,
        /https?:\/\/giphy\.com\/gifs\/(\w+)\/html5$/i,
        /https?:\/\/giphy\.com\/embed\/(\w+)/i        
    ],

    getLink: function(urlMatch, cb) {

        cb ({
            redirect: "http://giphy.com/gifs/" + urlMatch[1]
        });
    },

    tests: [{
        noFeeds: true,
        skipMethods: ["getLink"]
    },
        "http://media.giphy.com/media/m4r4RTpCzkh0I/giphy.gif",
        "http://i.giphy.com/10rNBP8yt1LUnm.gif",
        "http://giphy.com/gifs/FC8MlptXIrCWk/html5"
    ]
};