Skip to content

Instantly share code, notes, and snippets.

@wjessop
Created February 5, 2012 23:52
Show Gist options
  • Save wjessop/1748468 to your computer and use it in GitHub Desktop.
Save wjessop/1748468 to your computer and use it in GitHub Desktop.
<?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";
}
@zhongge
Copy link

zhongge commented Aug 4, 2014

Hi,
I'm very interested in this code.
I will be thanks if you give me your email address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment