"""Return True if a given place_name is in place_list."""
return any(x.full_name.lower() == place_name.lower() for x in place_list)
- twitter_hq = self.api.geo_similar_places(lat='37.7821120598956',
- long='-122.400612831116',
- name='South of Market Child Care')
- # Assumes that twitter_hq is first Place returned...
- self.assertEqual(twitter_hq[0].id, '1d019624e6b4dcff')
# Test various API functions using Austin, TX, USA
self.assertEqual(self.api.geo_id(id='1ffd3558f2e98349').full_name, 'Dogpatch, San Francisco')
self.assertTrue(place_name_in_list('Austin, TX',
'accuracy', 'max_results', 'contained_within']
)
- @property
- def geo_similar_places(self):
- """ :reference: https://dev.twitter.com/rest/reference/get/geo/similar_places
- :allowed_param:'lat', 'long', 'name', 'contained_within'
- """
- return bind_api(
- api=self,
- path='/geo/similar_places.json',
- payload_type='place', payload_list=True,
- allowed_param=['lat', 'long', 'name', 'contained_within']
- )
-
@property
def supported_languages(self):
""" :reference: https://developer.twitter.com/en/docs/developer-utilities/supported-languages/api-reference/get-help-languages """