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

Options Hash (options):

  • :max_id (Integer)
  • :since_id (Integer)
  • :min_id (Integer)
  • :limit (Integer)
  • :local (Boolean)
  • :only_media (Boolean)

43
44
45
# File 'lib/mastodon/rest/timelines.rb', line 43

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

Options Hash (options):

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

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

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

#list_timeline(id, options = {}) ⇒ Mastodon::Collection<Mastodon::Status>

Retrieve statuses from a list

Options Hash (options):

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

55
56
57
# File 'lib/mastodon/rest/timelines.rb', line 55

def list_timeline(id, options = {})
  perform_request_with_collection(:get, "/api/v1/timelines/list/#{id}", options, Mastodon::Status)
end

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

Retrieve statuses from the public timeline

Options Hash (options):

  • :max_id (Integer)
  • :since_id (Integer)
  • :min_id (Integer)
  • :limit (Integer)
  • :local (Boolean)
  • :only_media (Boolean)

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

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