<?php
/**
* photobucket
*
* Gets all the pictures from a Photobucket album.
*
* @version 0.2
* @author Contributors at eXorithm
* @link /algorithm/view/photobucket Listing at eXorithm
* @link /algorithm/history/photobucket History at eXorithm
* @license /home/show/license
*
* @param mixed $url Photobucket URL
* @return mixed
*/
function photobucket($url='http://s283.photobucket.com/albums/kk285/konnarak_1608/romantic/')
{
$str = file_get_contents($url);
preg_match_all('/<img[^>]+>/i',$str, $result);
$strPics = "";
foreach( $result as $img_tag) {
foreach( $img_tag as $img) {
if( !strpos($img, 'class="under off"') ) continue;
preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $img, $imgURLs);
$imgURL = str_replace("/th_", "/", $imgURLs[1]);
$strPics .= $imgURL . "\n";
}
}
return $strPics;
}
?>