lib/totter/client/timelines.rb in totter-0.3.2 vs lib/totter/client/timelines.rb in totter-0.3.3
- old
+ new
@@ -46,9 +46,21 @@
# Totter.global_timeline(limit: 20, since: '1,15')
def sticker_timeline(sticker, options = DEFAULT_TIMELINE_OPTIONS)
format_timeline_result get('timelines/global', options.merge({:sticker => sticker}))
end
+ # Get random decision from current timeline
+ #
+ # @param options [Hash] Parameters for returning selected item, defaults to golbal timeline
+ # @option options [String] :hashtag The hashtag timeline to use for random decision
+ # @option options [String] :sticker The sticker timeline to use for random decision
+ # @return Decision A `Hashie::Mash` object representing a random decision
+ # @example
+ # Totter.random_timeline_decision(hashtag: 'testhashtag')
+ def random_timeline_decision(options = {})
+ get('timelines/global/random', options.merge({:limit => 1})).body
+ end
+
# Search for published items
#
# @param query [String] The query to search for
# @param options [Hash] Parameters for returning selected items
# @option options [Numeric] :limit Number of items to return. Default is 20