Created
January 3, 2012 21:17
-
-
Save reinvented/1556980 to your computer and use it in GitHub Desktop.
Send PEI Energy Interchange report to a Nabaztag rabbit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$apiKey = "get this from nabaztag.com"; | |
$localDir = "/www/htdocs-ruk/nabaztag/wav"; | |
$webDir = "http://media.ruk.ca/nabaztag/wav"; | |
$id = uniqid(); | |
$nbso = simplexml_load_file("http://energy.reinvented.net/pei-energy/nbso/get-nbso-data.php?format=xml"); | |
$message = "P E I energy interchange is " . $nbso->PEI . " megawatts"; | |
system("/usr/local/bin/swift \"" . escapeshellarg($message) . "\" -o $localDir/$id.wav"); | |
$fp = fopen("http://www.nabalive.com/nabaztags/$apiKey/play?url=" . urlencode("$webDir/$id.wav"),"r"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment