Returns counts of tweets for a URL

 @param [String] url the url to look up
 @param [Hash] options method options
 @option options [String] :contains Query string to filter results
 @return [Topsy::Stats]
439112
def stats(url, options={})
      query = {:url => url}
      query.merge!(options)
      response = handle_response(get("/stats.json", :query => query))
      Topsy::Stats.new(response)
    end
1164811
def urlparams(url_, hash=None, **query):
    
    url = urlparse.urlparse(url_)
    fragment = hash if hash is not None else url.fragment

    # Use dict(parse_qsl) so we don't get lists of values.
    q = url.query
    query_dict = dict(urlparse.parse_qsl(smart_str(q))) if q else {}
    query_dict.update((k, v) for k, v in query.items())

    query_string = _urlencode([(k, v) for k, v in query_dict.items()
                               if v is not None])
    new = urlparse.ParseResult(url.scheme, url.netloc, url.path, url.params,
                               query_string, fragment)
    return new.geturl()
27402
def check_counts(self):
        
        if "counts" in re.split("[/.]", self.endpoint):
            logger.info("disabling tweet parsing due to counts API usage")
            self._tweet_func = lambda x: x
418281
def get(url)

      data = nil
      resp = HTTParty.get(url)

      if resp.code == 200
        return resp.body
      end
    end
101542
def list_links(args = {})
      if args.empty?
        links
      else
        links.select { |link| link.match? args }
      end
    end
10274
def parse_url(url)
      s = url

      # remove entities
      s = HTML_ENTITIES.decode(s)

      # fix a couple of common encoding bugs
      s = s.gsub(' ', '%20')
      s = s.gsub("'", '%27')

      # append query manually (instead of letting HTTParty handle it) so we can
      # include it in cache_key
      query = options.delete(:query)
      if query.present?
        q = HTTParty::HashConversions.to_params(query)
        separator = s.include?('?') ? '&' : '?'
        s = "#{s}#{separator}#{q}"
      end

      URI.parse(s)
    end
521555
function doQuery(options) {
            return models.Tag.findOne(options.data, _.omit(options, ['data']))
                .then((model) => {
                    if (!model) {
                        return Promise.reject(new common.errors.NotFoundError({
                            message: common.i18n.t('errors.api.tags.tagNotFound')
                        }));
                    }

                    return {
                        tags: [urlsForTag(model.id, model.toJSON(options), options)]
                    };
                });
        }
619369
def split_url(url)
      str = split_get_last(split_get_last(url, '/'), '?')
      str = split_get_last(str, '&', -1)
      str
    end
1330434
def process_url_params url, headers
      url_params = {}
      headers.delete_if do |key, value|
        if 'params' == key.to_s.downcase && value.is_a?(Hash)
          url_params.merge! value
          true
        else
          false
        end
      end
      unless url_params.empty?
        query_string = url_params.collect { |k, v| "#{k.to_s}=#{CGI::escape(v.to_s)}" }.join('&')
        url + "?#{query_string}"
      else
        url
      end
    end
95751
def get(url, params={}, options={})
      FreebaseAPI.logger.debug("GET #{url}")
      params[:key] = @key if @key
      options = { format: options[:format], query: params }
      options.merge!(@proxy_options)
      response = self.class.get(url, options)
      handle_response(response)
    end
1053779
def paginate(url, options = {}, &block)
      opts = options.dup
      if @auto_paginate || @per_page
        opts[:query] ||= {}
        opts[:query][:per_page] ||= @per_page || (@auto_paginate ? MAX_PER_PAGE : nil)
      end

      data = request(:get, url, nil, opts)

      if @auto_paginate
        while @last_response.rels[:next]
          @last_response = @last_response.rels[:next].get(headers: opts[:headers])
          if block_given?
            yield(data, @last_response)
          else
            data.concat(@last_response.data) if @last_response.data.is_a?(Array)
          end
        end
      end

      data
     end
1231593
def url_to_params(*args)
      if args.size < 2
        path = args[0]
        method = :client
      else
        path = args[1]
        method = args[0].to_sym
      end

      # First try a direct match
      result = @direct_routes[method][path]
      return result if result

      # Next, split the url and walk the sections
      parts = url_parts(path)

      match_path(parts, parts, @indirect_routes[method])
    end
1032332
def count(cls, **kwargs):
        
        url = recurly.base_uri() + cls.collection_path
        if kwargs:
            url = '%s?%s' % (url, urlencode_params(kwargs))
        return Page.count_for_url(url)
1197597
def stats!
      stats       = send_recv( KJess::Request::Stats.new )
      raise KJess::ProtocolError, "Problem receiving stats: #{stats.inspect}" unless KJess::Response::Stats === stats

      h           = stats.data
      dump_stats  = send_recv( KJess::Request::DumpStats.new )
      h['queues'] = Hash.new
      if KJess::Response::DumpedStats === dump_stats then
        h['queues'].merge!( dump_stats.data )
      end
      return h
    end
1313392
def get_p2o_params_from_url(cls, url):
        

        # if the url doesn't contain a filter separator, return it
        if PRJ_JSON_FILTER_SEPARATOR not in url:
            return {"url": url}

        # otherwise, add the url to the params
        params = {'url': url.split(' ', 1)[0]}
        # tokenize the filter and add them to the param dict
        tokens = url.split(PRJ_JSON_FILTER_SEPARATOR)[1:]

        if len(tokens) > 1:
            cause = "Too many filters defined for %s, only the first one is considered" % url
            logger.warning(cause)

        token = tokens[0]
        filter_tokens = token.split(PRJ_JSON_FILTER_OP_ASSIGNMENT)

        if len(filter_tokens) != 2:
            cause = "Too many tokens after splitting for %s in %s" % (token, url)
            logger.error(cause)
            raise ELKError(cause=cause)

        fltr_name = filter_tokens[0].strip()
        fltr_value = filter_tokens[1].strip()

        params['filter-' + fltr_name] = fltr_value

        return params
1119592
def get(url, params = {})
      result({"ResponseGroup" => "Related,TrafficData,ContentData", "Url" => url}, params) do |doc|
        @document = doc

        {
          speed_median_load_time:       speed_median_load_time,
          speed_load_percentile:        speed_load_percentile,
          link_count:                   link_count,
          ranking:                      ranking,
          ranking_delta:                ranking_delta,
          reach_rank:                   reach_rank,
          reach_rank_delta:             reach_rank_delta,
          reach_per_million:            reach_per_million,
          reach_per_million_delta:      reach_per_million_delta,
          page_views_rank:              page_views_rank,
          page_views_rank_delta:        page_views_rank_delta,
          page_views_per_million:       page_views_per_million,
          page_views_per_million_delta: page_views_per_million_delta,
          page_views_per_user:          page_views_per_user,
          page_views_per_user_delta:    page_views_per_user_delta
        }
      end
    end
966112
function doQuery(options) {
            return models.Tag.findPage(options)
                .then(({data, meta}) => {
                    return {
                        tags: data.map(model => urlsForTag(model.id, model.toJSON(options), options)),
                        meta: meta
                    };
                });
        }