Skip to content

Instantly share code, notes, and snippets.

@stevelacey
Created January 24, 2011 16:45
Show Gist options
  • Save stevelacey/793499 to your computer and use it in GitHub Desktop.
Save stevelacey/793499 to your computer and use it in GitHub Desktop.
sentiment.php
<?php
$response = file_get_contents('http://data.tweetsentiments.com:8080/api/analyze.json?'.http_build_query(array('q' => $_GET['tweet'])));
$json = json_decode($response);
echo $json->sentiment->name,"\n",$json->sentiment->value,"\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment