def generate_url url, token, type, version
      case type
      when 'analyze'
        url = "http://api.diffbot.com/v3/#{type}?token=#{token}&url=#{url}"
      when 'custom'
        url = "http://api.diffbot.com/v3/#{options[:api_name]}?token=#{token}&url=#{url}"
      when 'article', 'image', 'product'
        url = "http://api.diffbot.com/v2/#{type}?token=#{token}&url=#{url}"
        url = "http://api.diffbot.com/#{version}/#{type}?token=#{token}&url=#{url}" if version == 'v2' || version == 'v3'
      end
      url
    end
def generate_url url, token, type, version
      case type
      when 'analyze'
        url = "http://api.diffbot.com/v3/#{type}?token=#{token}&url=#{url}"
      when 'custom'
        url = "http://api.diffbot.com/v3/#{options[:api_name]}?token=#{token}&url=#{url}"
      when 'article', 'image', 'product'
        url = "http://api.diffbot.com/v2/#{type}?token=#{token}&url=#{url}"
        url = "http://api.diffbot.com/#{version}/#{type}?token=#{token}&url=#{url}" if version == 'v2' || version == 'v3'
      end
      url
    end
generate an url consisting of your api key and the endpoint you'd like to use

 @param url [String] The url to pass to diffbot
 @param token [String] Diffbot API token
 @param type [String] API to use
 @return [String] a formatted url with your api key, endpoint and input url