Skip to content

Instantly share code, notes, and snippets.

@cwittyman
Created September 10, 2012 17:52
Show Gist options
  • Save cwittyman/3692510 to your computer and use it in GitHub Desktop.
Save cwittyman/3692510 to your computer and use it in GitHub Desktop.
Vimeo PHP feed
// Vimeo
for($i=1;$i<4;$i++){
$feed = "http://vimeo.com/api/v2/channel/383424/videos.xml?page=" . $i;
$videos = simplexml_load_file($feed);
foreach($videos->video as $video){
$vurl = $video->id;
$vsmall = $video->thumbnail_medium;
$created = $video->upload_date;
$url = $vsmall;
$dir = "/var/www/html/static/social_pics/";
file_put_contents($dir. basename($url), file_get_contents($url));
$out = "";
$out .= '<li><a href="//vimeo.com/'.$vurl.'" class="vimeo" data-fancybox-type="iframe"><img src="/static/social_pics/' .basename($vsmall) .'" /></a><span class="vimeo-title">'.$video->title.'</span><span class="vimeo-desc">'.$video->description.'</span></li>';
$data = array('category' => 'vimeo', 'Vdata' => $out, 'VID' => $vurl);
$sql = $express->EE->db->insert_string('social_aggregator_background', $data);
$express->EE->db->query($sql);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment