当前位置: 首页>>代码示例>>PHP>>正文


PHP Browser::read方法代码示例

本文整理汇总了PHP中Browser::read方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::read方法的具体用法?PHP Browser::read怎么用?PHP Browser::read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Browser的用法示例。


在下文中一共展示了Browser::read方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cacheurl

function cacheurl($url, $browser_req = true, $cookies = "", $browser = "Firefox")
{
    global $myconfig;
    #find cache file
    $hash = md5($url);
    $datei = "cache/" . $hash;
    if (file_exists($datei)) {
        if (time() - filemtime($datei) < $myconfig['cachetime']) {
            return implode('', file($datei));
        }
    }
    #no cache file exists send browser request
    if ($browser_req == true) {
        $objekt = new Browser($browser);
        if ($cookies != "") {
            $objekt->cookies_set($cookies);
        }
        $objekt->url = $url;
        $t_html = $objekt->read();
    } else {
        $t_html = implode('', file($url));
    }
    d_write($datei, $t_html);
    return $t_html;
}
开发者ID:BackupTheBerlios,项目名称:onlinestreams-svn,代码行数:25,代码来源:inc.php

示例2: myvideo_flv_download

/**
 * Parse the video url of a given myvideo video link site
 * and returns the http url of the video
 * * 
 * @param string $url
 *   url of video must contain watch/*
 *   http://www.myvideo.de/watch/7125794
 * @return string
 *   the url of the video as http url; should the flv file
 */
function myvideo_flv_download($url)
{
    preg_match('|watch/(\\d+)/|i', $url, $match);
    $objekt = new Browser($browser);
    if ($cookies != "") {
        $objekt->cookies_set($cookies);
    }
    $objekt->url = "http://www.myvideo.de/movie/" . $match[1];
    $objekt->read();
    $head = $objekt->returnHeader();
    preg_match('/V\\=(.*?).flv/', $head['Location'], $matches);
    return urldecode($matches[1]) . ".flv";
}
开发者ID:BackupTheBerlios,项目名称:onlinestreams-svn,代码行数:23,代码来源:MyVideo.php

示例3: sub_navi2

function sub_navi2($url)
{
    $z = split(",", trim($url['keys'], "()"));
    $objekt = new Browser("Firefox");
    $objekt->url = $url['url'];
    $objekt->post = array("xajax" => "show_top_and_movies&xajaxr=1205505927158&xajaxargs[]=0&xajaxargs[]=" . trim($z[1], "'") . "&xajaxargs[]=" . trim($z[2], "'") . "&xajaxargs[]=0&xajaxargs[]=0&xajaxargs[]=0");
    $t_html = $objekt->read();
    #         preg_match_all('|div class="number">(.*?)</div><div class="time">(.*?)</div>(?:.*?)<div class="buy">(?:.*?)<a href=(.*?)>ansehen</a>(?:.*?)<div class="title" >(?:.*?)>(.*?)</a>|si',$t_html,$matches);
    preg_match_all('|href(?:.*?)>(?:.*?)</a>(?:.*?)</a>|si', $t_html, $matches);
    foreach ($matches[0] as $row) {
        $row = "<a " . $row;
        $row = str_replace(">.<", "", $row);
        $row = str_replace(">0.<", "", $row);
        $row = str_replace("kostenlos", "", $row);
        $row = trim($row);
        preg_match('|href="(.*?)">|si', $t_html, $link);
        $tmp_array['url'] = "http://rtl-now.rtl.de/" . str_replace("_produktdetail", "", $link[1]) . "&player=1";
        #                 $tmp_array['time']=strtotime($matches[2][$key]);
        $tmp_array['title'] = reducehtml(strip_tags($row));
        $tmp_array['type'] = "file";
        $out[$tmp_array['title']] = $tmp_array;
    }
    return $out;
}
开发者ID:BackupTheBerlios,项目名称:onlinestreams-svn,代码行数:24,代码来源:RTLnow.php


注:本文中的Browser::read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。