{
$this->outputXML = false;
+ $limit = time() - (3600 * 24 * 2);
+ $cache = WS_CACHE . '/pinterest/' . sha1($this->args['url']);
header('Content-type: application/rss+xml');
- $url = 'https://www.pinterest.com/' . urlencode($this->args['url']);
+
ob_end_clean();
+ if (file_exists($cache) && filemtime($cache) > $limit) {
+ echo file_get_contents($cache);
+ exit;
+ }
+
+ $url = 'https://www.pinterest.com/' . urlencode($this->args['url']);
$c = file_get_contents($url);
- echo $c;
+ if($c) {
+ file_put_contents($c, $cache);
+ echo $c;
+ }else{
+ echo file_get_contents($cache);
+ }
exit;
}