Module: Twitter::Client::Urls

Included in:
Twitter::Client
Defined in:
lib/twitter/client/urls.rb

Overview

Defines methods related to URLs

Instance Method Summary collapse

Instance Method Details

#resolve(urls, options = {}) ⇒ Hash

Note:

Undocumented

Returns the canonical version of a URL shortened by Twitter

Returns A hash of URLs with the shortened URLs as the key.

Examples:

Return the canonical version of a URL shortened by Twitter

Twitter.resolve('http://t.co/uw5bn1w', 'http://t.co/dXvMz9i')
Twitter.resolve(['http://t.co/uw5bn1w', 'http://t.co/dXvMz9i']) # Same as above

Parameters:

  • urls (String)

    A list of shortened URLs.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Hash)

    A hash of URLs with the shortened URLs as the key

Raises:

Rate Limited?:

  • Yes

Requires Authentication?:

  • Yes



19
20
21
22
# File 'lib/twitter/client/urls.rb', line 19

def resolve(*args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  get("/1/urls/resolve.json", options.merge("urls[]" => args), :phoenix => true)
end