alles andere entspr. "suche_global"
// url-format
// http://www.deineurl.com/deinpfad/search1.php?abfrage=keyword&limit=20&ausg=1&smodus=0
$consumerkey = "";
$consumersecret = "";
$accesstoken = "";
$accesstokensecret = "";
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
return $connection;
}
$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
switch ($modus) {
case 0:
$search="#".$search;
break;
}
$search = str_replace("#", "%23", $search);
$tweets = $connection->get("https://api.twitter.com/1.1/search/tweets.json?q=".$search."&count=".$notweets);
$summe=$tweets->search_metadata->count;
$zahl=$summe;
$a=0;
switch ($ausgabe) {
case 0:
echo "
";
print_r($tweets);
echo "
";
break;
case 1:
echo "";
echo "";
echo "Text/Statusmeldung | ";
echo "Username | ";
echo "Publish-Datum | ";
echo "
";
while($a <= $zahl)
{
echo "";
echo "".utf8_decode($tweets->statuses[$a]->text)." | ";
echo "".utf8_decode($tweets->statuses[$a]->user->name)." | ";
echo "".$tweets->statuses[$a]->created_at." | ";
$a++;
echo "
";
}
echo "
";
break;
case 2:
echo "";
echo "";
echo "Text/Statusmeldung | ";
echo "Publish-Datum | ";
echo "
";
while($a <= $zahl)
{
echo "";
echo "".utf8_decode($tweets->statuses[$a]->text)." | ";
echo "".$tweets->statuses[$a]->created_at." | ";
$a++;
echo "
";
}
echo "
";
break;
case 3:
while($a <= $zahl)
{
echo utf8_decode($tweets->statuses[$a]->text)."";
$a++;
}
break;
}
?>