index.js
function getVisUrl(url) {
    var match = /https?:\/\/(\S+)\.cartodb\.com\/viz\/(\S+)\/(?:public_)?map/.exec(url);
    if (match) {
        var user = match[1],
            mapId = match[2];
        return 'https://' + user + '.cartodb.com/api/v2/viz/' + mapId + '/viz.json';
    }
}
function getVisUrl(url) {
    var match = /https?:\/\/(\S+)\.cartodb\.com\/viz\/(\S+)\/(?:public_)?map/.exec(url);
    if (match) {
        var user = match[1],
            mapId = match[2];
        return 'https://' + user + '.cartodb.com/api/v2/viz/' + mapId + '/viz.json';
    }
}
function getVisUrl ( url ) { var match = / https?:\/\/(\S+)\.cartodb\.com\/viz\/(\S+)\/(?:public_)?map / . exec ( url ) ; if ( match ) { var user = match [ 1 ] , mapId = match [ 2 ] ; return 'https://' + user + '.cartodb.com/api/v2/viz/' + mapId + '/viz.json' ; } }
Convert a map's url into the viz.json url for that map.

@param {String} url the map's url
@return {String} the viz.json url, if found
Convert a map s url into the viz . json url for that map .