Inhaltsverzeichnis

Twitter

OAuth for PHP Twitter Apps

Part 1: http://articles.sitepoint.com/article/oauth-for-php-twitter-apps-part-1

Twitter nach Text durchsuchen & den Leuten antworten

<?php

$searchtext == "Was suche ich";
$tag = "Deppenantwort";

$url = "http://search.twitter.com/search.atom?q=".urlencode($searchtext);

$data = simplexml_load_file($url);

foreach ($data->entry as $value){
	$from_name = $value->author->uri;
	$from_name = str_replace ("http://twitter.com/", "", $from_name);
    	$message = "@$from_name Das stimmt nicht. #".$tag;

		require_once( 'mytwitter.php' );
		$twitter =  new MyTwitter('kuskus', '**********');
 		$result = $twitter->updateStatus($message);
}
?>