Created
September 19, 2014 03:31
-
-
Save andrewwatson/1d2f1e2ff1b336408162 to your computer and use it in GitHub Desktop.
Respond to Twilio SMS with a random cat photo
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 | |
$xml = new SimpleXmlElement(file_get_contents("http://thecatapi.com/api/images/get?format=xml&results_per_page=1&size=small")); | |
$cat_picture = $xml->data->images[0]->image->url; | |
?> | |
<Response> | |
<Message> | |
<Body>Meow!</Body> | |
<Media><?php echo $cat_picture; ?></Media> | |
</Message> | |
</Response> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment