TijsVerkoyen\Twitter\Twitter::trendsAvailable PHP Method

trendsAvailable() public method

The response is an array of "locations" that encode the location's WOEID (a Yahoo! Where On Earth ID) and some other human-readable information such as a canonical name and country the location belongs in. The WOEID that is returned in the location object is to be used when querying for a specific trend.
public trendsAvailable ( float[optional] $lat = null, float[optional] $long = null ) : array
$lat float[optional]
$long float[optional]
return array
    public function trendsAvailable($lat = null, $long = null)
    {
        // build parameters
        $parameters = null;
        if ($lat != null) {
            $parameters['lat_for_trends'] = (double) $lat;
        }
        if ($long != null) {
            $parameters['long_for_trends'] = (double) $long;
        }
        // make the call
        return $this->doCall('trends/available.json', $parameters);
    }

Usage Example

 /**
  * Tests Twitter->trendsAvailable()
  */
 public function testTrendsAvailable()
 {
     $response = $this->twitter->trendsAvailable();
     foreach ($response as $row) {
         $this->isTrend($row);
     }
 }
Twitter