Created
December 6, 2011 21:42
-
-
Save terinjokes/1440131 to your computer and use it in GitHub Desktop.
Fortune Web API
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 | |
# A server I use doesn't have fortune installed, so created this small script to fetch one from a web api and display it on login | |
$json = file_get_contents("http://www.iheartquotes.com/api/v1/random?source=prog_style+osp_rules+math+humorix_misc+oneliners+riddles&format=json", "r"); | |
$json = json_decode($json); | |
echo wordwrap($json->quote); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment