Module: Mastodon::REST::Timelines

Includes:
Utils
Included in:
API
Defined in:
lib/mastodon/rest/timelines.rb

Instance Method Summary collapse

Methods included from Utils

#array_param, #perform_request, #perform_request_with_collection, #perform_request_with_object

Instance Method Details

#hashtag_timeline(hashtag, options = {}) ⇒ Mastodon::Collection<Mastodon::Status>

Retrieve statuses from a hashtag

Parameters:

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

Options Hash (options):

  • :max_id (Integer)
  • :since_id (Integer)
  • :limit (Integer)

Returns:



40
41
42
43
44
# File 'lib/mastodon/rest/timelines.rb', line 40

def hashtag_timeline(hashtag, options = {})
  perform_request_with_collection(:get,
                                  "/api/v1/timelines/tag/#{hashtag}",
                                  options, Mastodon::Status)
end

#home_timeline(options = {}) ⇒ Mastodon::Collection<Mastodon::Status>

Retrieve statuses from the home timeline

Parameters:

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

Options Hash (options):

  • :max_id (Integer)
  • :since_id (Integer)
  • :limit (Integer)

Returns:



17
18
19
20
# File 'lib/mastodon/rest/timelines.rb', line 17

def home_timeline(options = {})
  perform_request_with_collection(:get, '/api/v1/timelines/home',
                                  options, Mastodon::Status)
end

#public_timeline(options = {}) ⇒ Mastodon::Collection<Mastodon::Status>

Retrieve statuses from the public timeline

Parameters:

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

Options Hash (options):

  • :max_id (Integer)
  • :since_id (Integer)
  • :limit (Integer)

Returns:



28
29
30
31
# File 'lib/mastodon/rest/timelines.rb', line 28

def public_timeline(options = {})
  perform_request_with_collection(:get, '/api/v1/timelines/public',
                                  options, Mastodon::Status)
end