Created
February 5, 2012 23:52
-
-
Save wjessop/1748468 to your computer and use it in GitHub Desktop.
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 | |
$group_url = urlencode("http://tech.dir.groups.yahoo.com/group/OneStopCOBOL"); | |
$api_url = "http://yahoo-group-data.herokuapp.com/api/v1/group/$group_url"; | |
if (ini_get('allow_url_fopen') == '1') { | |
if ($fp = fopen($api_url, 'r')) { | |
$content = ''; | |
// keep reading until there's nothing left | |
while ($line = fread($fp, 1024)) { | |
$content .= $line; | |
} | |
// $content is the json returned | |
echo $content; | |
} | |
} else { | |
echo "fopen can't open URLs, perhaps use cURL: http://php.net/manual/en/book.curl.php"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm very interested in this code.
I will be thanks if you give me your email address.