0

I am searching for tweets within the UK ONLY, how to I search using geo code?

$results = $twitter->search(array('q' => 'my search', 'geocode' => 'xxxx,yyyy,zzzzkm'));

What do I put for xxxx, yyyy and zzzz ?

Is it possible to search by country not geocode?

Mike Zriel
  • 1,575
  • 1
  • 17
  • 28

2 Answers2

0

According to documentation geocode parameter:

Returns tweets by users located within a given radius of the given latitude/longitude. The location is preferentially taking from the Geotagging API, but will fall back to their Twitter profile. The parameter value is specified by “latitude,longitude,radius”, where radius units must be specified as either “mi” (miles) or “km” (kilometers). Note that you cannot use the near operator via the API to geocode arbitrary locations; however you can use this geocode parameter to search near geocodes directly. A maximum of 1,000 distinct “sub-regions” will be considered when using the radius modifier.

Example Values: 37.781157,-122.398720,1mi

If you want to search for country take a look at this question.

Community
  • 1
  • 1
marian0
  • 3,336
  • 3
  • 27
  • 37
0

Search Twitter by country:

$results = $twitter->search(array('q' => 'my search', 'place' => array('country' => 'United Kingdom') ) );
Mike Zriel
  • 1,575
  • 1
  • 17
  • 28