TijsVerkoyen\Twitter\Twitter::geoPlace PHP Method

geoPlace() public method

Creates a new place at the given latitude and longitude.
public geoPlace ( string $name, string $containedWithin, string $token, float $lat, float $long, array $attributes = null ) : array
$name string The name a place is known as.
$containedWithin string The place_id within which the new place can be found. Try and be as close as possible with the containing place. For example, for a room in a building, set the contained_within as the building place_id.
$token string The token found in the response from geo/similar_places.
$lat float The latitude the place is located at. This parameter will be ignored unless it is inside the range -90.0 to +90.0 (North is positive) inclusive. It will also be ignored if there isn't a corresponding long parameter.
$long float The longitude the place is located at. The valid ranges for longitude is -180.0 to +180.0 (East is positive) inclusive. This parameter will be ignored if outside that range, if it is not a number, if geo_enabled is disabled, or if there not a corresponding lat parameter.
$attributes array
return array
    public function geoPlace($name, $containedWithin, $token, $lat, $long, array $attributes = null)
    {
        // build parameters
        $parameters['name'] = (string) $name;
        $parameters['contained_within'] = (string) $containedWithin;
        $parameters['token'] = (string) $token;
        $parameters['lat'] = (double) $lat;
        $parameters['long'] = (double) $long;
        if ($attributes != null) {
            foreach ($attributes as $key => $value) {
                $parameters['attribute:' . $key] = (string) $value;
            }
        }
        // make the call
        return $this->doCall('geo/create.json', $parameters, true, 'POST');
    }
Twitter