Beispiel #1
0
function process_itunes_url($req_url)
{
    //https://itunes.apple.com/cn/app/mysterious-cities-gold-secret/id739095583?mt=8&uo=4
    //http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/wa/wsLookup?id=739095583&country=cn
    preg_match('|^https?://itunes.apple.com/(\\S*)/app\\S*/id(\\d+)(\\?mt\\=\\d+){0,1}.*$|i', $req_url, $matches);
    if ($matches == null || $matches[0] == null) {
        return false;
    }
    $country = @$matches[1];
    $appid = $matches[2];
    if ($country == null || $country == "") {
        $country = "us";
    } else {
        $country = substr($country, 0, 2);
    }
    return get_itunes($appid, $country);
}
Beispiel #2
0
function extract_items($site, $content)
{
    switch ($site) {
        case 'flickr':
            //ok
            $items = get_flickr($content);
            break;
        case 'ffffound':
            //ok
            $items = get_ffffound($content);
            break;
        case 'dribbble':
            //ok
            $items = get_dribbble($content);
            break;
        case 'imgur':
            //ok
            $items = get_imgur($content);
            break;
        case 'picplz':
            //ok
            $items = get_picplz($content);
            break;
        case 'instagram':
            //ok
            $items = get_instagram($content);
            break;
        case 'delicious':
            //ok
            $items = get_delicious($content);
            break;
        case 'hn':
            //ok
            $items = get_delicious($content);
            break;
        case 'reddit':
            //ok
            $items = get_delicious($content);
            break;
        case 'pinboard':
            //ok
            $items = get_pinboard($content);
            break;
        case 'digg':
            //ok
            $items = get_digg($content);
            break;
        case 'youtube':
            //ok
            $items = get_youtube($content);
            break;
        case 'hulu':
            //ok
            $items = get_hulu($content);
            break;
        case 'yahoovideos':
            //ok
            $items = get_yahoovideos($content);
            break;
        case 'yahoobuzz':
            //ok
            $items = get_yahoobuzz($content);
            break;
        case 'googletrends':
            //ok
            $items = get_googletrends($content);
            break;
        case 'amazon':
            //ok
            $items = get_amazon($content);
            break;
        case 'itunes':
            //ok
            $items = get_itunes($content);
            break;
        case 'wearehunted':
            //ok
            $items = get_wearehunted($content);
            break;
        case 'twitter':
            //ok
            $items = get_twitter($content);
            break;
        case 'wordpress':
            //ok
            $items = get_delicious($content);
            break;
    }
    return $items;
}