Module: X::Objects::Lookups::Trends

Included in:
API
Defined in:
x-objects/lib/x/objects/lookups/trends.rb

Overview

Read the topics trending in a place, and for the authenticated user, mixed into a client through API

Internal to x-objects: X::Objects::API includes it, and its methods are public API of the client that includes API, but the module is only how they are grouped, so include API rather than this module alone.

Instance Method Summary collapse

Instance Method Details

The topics trending for the authenticated user

Examples:

Print the topics trending for the authenticated user

client.personalized_trends.each { |trend| puts trend.name }

Parameters:

  • params (Hash) —

    query parameters merged over the default parameters

Returns:



34
# File 'x-objects/lib/x/objects/lookups/trends.rb', line 34

def personalized_trends(**params) = PersonalizedTrend.all(client: self, **params)

The topics trending in a place

Examples:

Print the ten topics trending most in the world

client.trends(1, max_trends: 10).each { |trend| puts trend.name }

Parameters:

  • woeid (Integer, String) —

    the Yahoo! Where On Earth identifier of the place, such as 1 for the world

  • params (Hash) —

    query parameters, such as max_trends, which is 50, the most the API returns, unless given

Returns:

  • (Array<Trend>) —

    the trends, frozen

Raises:

  • (ArgumentError) —

    if the WOEID is not a number, before a request



25
# File 'x-objects/lib/x/objects/lookups/trends.rb', line 25

def trends(woeid, **params) = Trend.at(woeid, client: self, **params)