I am trying to get all the tweets using the GET search/tweets of the Twitter REST API and map them onto Google Maps.
I am running to different queries:
To get all tweets in a radius based on the user location.
$lat = $_REQUEST['lat'];
$lon = $_REQUEST['lon'];
$rad = $_REQUEST['rad'];
$url = 'https://api.twitter.com/1.1/search/tweets.json';
$getfield = '?q=&count=100&result_type=recent&lang=en&geocode='.$lat.','.$lon.','.$rad.'mi';
To get all tweets irrespective of the user location. So what I want is all tweets around the world.
$url = 'https://api.twitter.com/1.1/search/tweets.json';
$getfield = '?q=&count=100&result_type=recent&lang=en';
The 1st query returns a JSON with all the tweets but I get an error in the 2nd query saying “Query parameters are missing”.
Note: In the 1st query the “q” parameter is also set to null likewise in the 2nd query.
I wanted to know the reason for the same.