index.js
function (options, callback) {
    var reqOptions = {
      api: (options ? options.api : null) || 'gifs',
      endpoint: 'random'
    };

    if (typeof options === 'string') {
      reqOptions.query = {
        tag: options
      };
    } else if (typeof options === 'object') {
      reqOptions.query = options;
    } else if (typeof options === 'function') {
      callback = options;
    }

    return this._request(reqOptions, callback);
  }
function (options, callback) {
    var reqOptions = {
      api: (options ? options.api : null) || 'gifs',
      endpoint: 'random'
    };

    if (typeof options === 'string') {
      reqOptions.query = {
        tag: options
      };
    } else if (typeof options === 'object') {
      reqOptions.query = options;
    } else if (typeof options === 'function') {
      callback = options;
    }

    return this._request(reqOptions, callback);
  }
function ( options , callback ) { var reqOptions = { api : ( options ? options . api : null ) || 'gifs' , endpoint : 'random' } ; if ( typeof options === 'string' ) { reqOptions . query = { tag : options } ; } else if ( typeof options === 'object' ) { reqOptions . query = options ; } else if ( typeof options === 'function' ) { callback = options ; } return this . _request ( reqOptions , callback ) ; }
Fetch random gif filtered by tag

@param options Giphy API random options
options.tag {String} - the GIF tag to limit randomness by
options.rating {String} - limit results to those rated (y,g, pg, pg-13 or r).
options.fmt {Stirng} - (optional) return results in html or json format (useful for viewing responses as GIFs to debug/test)
Fetch random gif filtered by tag