Make

Facebook Twitter

Build

Arduino. Making the World a Better Place, One Evil Mad Scientist at a Time. Makezine.com: MAKE: technology on your time. Introducing. <?

Introducing

Php include_once ( 'class.twitter.php' ); // $ioBridgeJSONFeedURL = ' ; $buzzerOnURL = ' ; $buzzerOffURL = ' ; $t = new twitter ; $t -> username = 'twitter_username' ; $t -> password = 'twitter_password' ; // Read the ID of the last reply $myFile = "lastreply.txt" ; $fileHandle = fopen ( $myFile , 'r' ); $lastReplyID = fgets ( $fileHandle ); fclose ( $fileHandle ); // Get the latest unanwsered replies $data = $t -> getReplies ( '' , '' , $lastReplyID ); $counter = 1 ; if ( ! Foreach ( $data as $tweet ) { if ( ! // Check for valid command if ( stripos ( $tweet -> text , "light" ){ // retrieve data from ioBridge.com $curl_handle = curl_init (); curl_setopt ( $curl_handle , CURLOPT_URL , $ioBridgeJSONFeedURL ); curl_setopt ( $curl_handle , CURLOPT_CONNECTTIMEOUT , 2 ); curl_setopt ( $curl_handle , CURLOPT_RETURNTRANSFER , 1 ); $ioBridgeResultsObject = curl_exec ( $curl_handle ); $ioBridgeResultsObject = json_decode ( $ioBridgeResultsObject ); curl_close ( $curl_handle ); $updateText = ' @' .

Else { // Send update.