I tried to use PHP Twitter API (users/show.json, version 1.1) to get the user details by passing username. It works great. My code is similar to this, using the library file.
But i want to know if it is possible to get the user data by passing website as the parameter (url, display_url or expanded_url). I have read the docs, but could not get any idea. Hope someone can help me.
EDIT: My updated code, used for testing:
<?php
require_once('TwitterAPIExchange.php');
$settings = array(
'oauth_access_token' => "xxxxxx-xxxxxxxxxxxxxxxxxx",
'oauth_access_token_secret' => "xxxxxxxxxxxxxxxxxxxxxxxx",
'consumer_key' => "xxxxxxxxxxxxxxxxxxxxxxxx",
'consumer_secret' => "xxxxxxxxxxxxxxxxxxxxxxxx"
);
$url = 'https://api.twitter.com/1.1/users/search.json';
$getfield = '?q=blessedsmiledentistry.com'; // Not working
//$getfield = '?q=stackoverflow.com'; // Working!
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
echo $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();
I see that, the search result for "stackoverflow.com" URL works fine, but i get an empty result with the URL: "blessedsmiledentistry.com". Not sure what i am doing wrong.
When i check the Twitter profiles related to my search terms, i did not find any major difference between them. Both profiles have name, handle, description, location, URL and joining date. But only the profile search for "stackoverflow.com" URL gives me a valid result. Is it because of the fact that "stackoverflow" is a verified Twitter account?