Created
November 18, 2012 06:34
-
-
Save robertcedwards/4103888 to your computer and use it in GitHub Desktop.
Alpha LED sign Foursquare Check-ins
This file contains hidden or 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 | |
$checkin = stripslashes($_POST["checkin"]); | |
$val = json_decode($checkin); | |
$firstname = $val->user->firstName; | |
$lastname = $val->user->lastName; | |
$display = $firstname . " " . $lastname . " just checked in! Welcome, " . $firstname . "!"; | |
$display = urlencode($display); | |
// I'm using +++ to indicate the start of the string and &&& to indicate the end for now | |
// I plan on writing Arduino code to interpret GET parameters so that it can be more | |
// easily ported for other uses. | |
$url = "http://ARDUINO_ADDRESS_HERE/+++" . $display . "&&&"; | |
$str = file_get_contents($url); | |
$myFile = "logFile.txt"; | |
$fh = fopen($myFile, 'a'); | |
$checkin .= "\n\n"; | |
fwrite($fh, $checkin); | |
fclose($fh); | |
echo "OK"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment