Module: Instagram::Client::Tags

Included in:
Instagram::Client
Defined in:
lib/instagram/client/tags.rb

Overview

Defines methods related to tags

Instance Method Summary (collapse)

Instance Method Details

- (Hashie::Mash) tag(tag)

Returns extended information of a given Instagram tag

Returns The requested tag.

Examples:

Return extended information for the tag "cat"

Instagram.tag('cat')

See Also:

  • url

Rate Limited:

  • true

Supported formats:

  • :json

Requires Authentication:

  • false



16
17
18
19
# File 'lib/instagram/client/tags.rb', line 16

def tag(tag, *args)
  response = get("tags/#{tag}")
  response
end

- (Hashie::Mash) tag_recent_media(tag, options = {})

Returns a list of recent media items for a given Instagram tag

Examples:

Return a list of the most recent media items tagged "cat"

Instagram.tag_recent_media('cat')

Options Hash (options):

  • :max_id (Integer) — default: nil

    Returns results with an ID less than (that is, older than) or equal to the specified ID.

  • :count (Integer) — default: nil

    Limits the number of results returned per page.

See Also:

  • url

Rate Limited:

  • true

Supported formats:

  • :json

Requires Authentication:

  • false



35
36
37
38
39
# File 'lib/instagram/client/tags.rb', line 35

def tag_recent_media(id, *args)
  options = args.last.is_a?(Hash) ? args.pop : {}
  response = get("tags/#{id}/media/recent", options)
  response
end

- (Hashie::Mash) tag_search(query, options = {})

Returns a list of tags starting with the given search query

Examples:

Return tags that start with "cat"

Instagram.tag_search("cat")

Options Hash (options):

  • :count (Integer)

    The number of media items to retrieve.

See Also:

  • url

Rate Limited:

  • true

Supported formats:

  • :json

Requires Authentication:

  • false



53
54
55
56
# File 'lib/instagram/client/tags.rb', line 53

def tag_search(query, options={})
  response = get('tags/search', options.merge(:q => query))
  response
end