Package blue.starry.penicillin.endpoints.geo

Types

Link copied to clipboard
enum GeoGranularity : Enum<GeoGranularity> , EnumRequestParameter

This is the minimal granularity of place types to return.

Functions

Link copied to clipboard
fun Geo.place(placeId: String, vararg options: Option): JsonObjectApiAction<Place>

Returns all the information about a known place.

Link copied to clipboard
fun Geo.reverseGeocode(    latitude: Double,     longitude: Double,     accuracy: String? = null,     granularity: GeoGranularity = GeoGranularity.Default,     maxResults: Int? = null,     vararg options: Option): JsonObjectApiAction<GeoResult>

Given a latitude and a longitude, searches for up to 20 places that can be used as a place_id when updating a status. This request is an informative call and will deliver generalized results about geography.

Link copied to clipboard
fun Geo.search(    latitude: Double? = null,     longitude: Double? = null,     query: String? = null,     ip: String? = null,     granularity: GeoGranularity? = null,     accuracy: String? = null,     maxResults: Int? = null,     containedWithin: String? = null,     attributeStreetAddress: String? = null,     callback: String? = null,     vararg options: Option): JsonObjectApiAction<GeoResult>

Search for places that can be attached to a Tweet via POST statuses/update. Given a latitude and a longitude pair, an IP address, or a name, this request will return a list of all the valid places that can be used as the place_id when updating a status. Conceptually, a query can be made from the user's location, retrieve a list of places, have the user validate the location they are at, and then send the ID of this location with a call to POST statuses/update. This is the recommended method to use find places that can be attached to statuses/update. Unlike GET geo/reverse_geocode which provides raw data access, this endpoint can potentially re-order places with regards to the user who is authenticated. This approach is also preferred for interactive place matching with the user. Some parameters in this method are only required based on the existence of other parameters. For instance, "lat" is required if "long" is provided, and vice-versa. Authentication is recommended, but not required with this method.