示例#1
0
function prefetch_wikipedia_search($procd_descr)
{
    profiling_start('prefetch_wikipedia_search');
    $TERMS = wikipedia_process_term($procd_descr);
    $url = wikipedia_url($TERMS);
    async_cache_file($url, 2);
    profiling_end('prefetch_wikipedia_search');
}
示例#2
0
function prefetch_google_search($procd_descr)
{
    profiling_start('prefetch_google_search');
    $TERMS = urlencode($procd_descr . " Lecture Notes");
    $USERIP = $_SERVER['REMOTE_ADDR'];
    $url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q={$TERMS}&rsz=small";
    async_cache_file($url, 1);
    profiling_end('prefetch_google_search');
    return $store;
}
示例#3
0
function prefetch_itunesu_search($procd_descr)
{
    $TERMS = urlencode($procd_descr);
    $USERIP = $_SERVER['REMOTE_ADDR'];
    $NRESULTS = 4;
    profiling_start('prefetch_itunesu_search');
    ini_set('user_agent', 'iTunes/8.1');
    $url = "http://ax.search.itunes.apple.com/WebObjects/MZSearch.woa/wa/advancedSearch?descriptionTerm={$TERMS}&media=iTunesU";
    async_cache_file($url, 3);
    profiling_start('prefetch_itunesu_search');
}
示例#4
0
function prefetch_youtube_query($TERMS, $srch, $crs)
{
    global $CONFIG;
    profiling_start('prefetch_youtube_query');
    $TAGS = $srch;
    $rtags = get_full_tags($crs);
    $str = urlencode($TERMS);
    //."+".implode("+", $srch);
    $url = "http://gdata.youtube.com/feeds/api/videos?q={$str}&orderby=relevance&start-index=1&max-results=2&v=2&format=5";
    async_cache_file($url, 2);
    profiling_end('prefetch_youtube_query');
}