TijsVerkoyen\Twitter\Twitter::trendsClosest PHP Метод

trendsClosest() публичный Метод

The response is an array of "locations" that encode the location's WOEID and some other human-readable information such as a canonical name and country the location belongs in.
public trendsClosest ( float[optional] $lat = null, float[optional] $long = null ) : array
$lat float[optional]
$long float[optional]
Результат array
    public function trendsClosest($lat = null, $long = null)
    {
        // build parameters
        $parameters = null;
        if ($lat != null) {
            $parameters['lat'] = (double) $lat;
        }
        if ($long != null) {
            $parameters['long'] = (double) $long;
        }
        // make the call
        return $this->doCall('trends/closest.json', $parameters);
    }

Usage Example

Пример #1
0
 /**
  * Tests Twitter->trendsClosest()
  */
 public function testTrendsClosest()
 {
     $response = $this->twitter->trendsClosest(37.781157, -122.400612831116);
     foreach ($response as $row) {
         $this->isTrend($row);
     }
 }
Twitter