Skip to content

Instantly share code, notes, and snippets.

@daigofuji
Created April 12, 2012 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daigofuji/2369158 to your computer and use it in GitHub Desktop.
Save daigofuji/2369158 to your computer and use it in GitHub Desktop.
Get Pipes jason and process it using php
$yahooPipesURL = "http://pipes.yahoo.com/pipes/pipe.run?_id=89dba5fe8716d4e780a80206edda2da6&_render=json";
// the old way
//$session = curl_init($yahooPipesURL);
//curl_setopt($session, CURLOPT_HEADER, false);
//curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
//$resultsJson = curl_exec($session);
//curl_close($session);
// the new way
$resultsJson = file_get_contents($yahooPipesURL);
//for debug
//echo $resultsJson;
$results = json_decode($resultsJson);
//see results
//print_r($results);
foreach ($results->{'value'}->{'items'} as $result)
{
$strLink = $result->{'link'};
$strTitle = $result->{'title'};
$strDesc = $result->{'description'};
$strDesc = strip_tags($strDesc);
//and so forth...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment