use phpFastCache\CacheManager;
$cache = CacheManager::Memcached();
// try to get from Cache first.
$resultsItem = $cache->getItem("identity_keyword")
if(!$resultsItem->isHit()) {
$resultsItem->set($cURL->get("http://www.youtube.com/api/json/url/keyword/page"))->expireAfter(3600*24);
$cache->save($resultsItem);
}
$results = $resultsItem->get();
foreach($results as $video) {
// Output Your Contents HERE
}
Forked from Geolim4/Improve cURL & API Calls.md
Last active
January 11, 2017 20:52
-
-
Save vukanac/789015a9527a6d88ca8a6ab6c2583afb to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Get real content from ResultsItem.