I want to add a language parameter. Suppose the user clicks on English, he will get tweets only in English. Right now I am using en by default, but I want support for multiple language
function twitter_class()
{
$this->realNamePattern = '/\((.*?)\)/';
$this->searchURL = 'http://search.twitter.com/search.atom?lang=en&q=';
}
$ch= curl_init($this->searchURL . urlencode($q));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
I want to get the language input from the user.
You can make
searchURLsome parametrized string function:When you invoke it, do it like this:
Hope this is helpful.
If you don’t have PHP 5.3, just write it as a standard class function: