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


PHP Crawler::cutafter方法代码示例

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


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

示例1: crawl_indowebster

function crawl_indowebster($url)
{
    //echo "'$url'";
    $craw = new Crawler($url);
    $craw->go2lineregexor('/(<\\/div><\\/a><\\/div><\\/div>)/', 1, 'href="#idws7"');
    $setring = $craw->getbetween('location.href=\'', '\'');
    $path = Crawler::extract($setring, 'path=', '&');
    $file_orig = Crawler::cutafter($setring, 'file_orig=');
    $craw->close();
    return '<a href="' . dirname($setring) . '/' . $path . '">' . rawurldecode($file_orig) . '</a>';
}
开发者ID:JerryMaheswara,项目名称:crawler,代码行数:11,代码来源:indowebster.php

示例2: go

 public function go()
 {
     $mark1 = '<a target="_blank" title="Show fullsized image" href=';
     $mark2 = '<a title="Next Image" rel="next" href=';
     $host = 'http://lu.scio.us';
     $finish = false;
     $number = 0;
     $url = $this->url;
     preg_match('/\\/([^\\/]+)\\/page\\/1/', $url, $m);
     $text = $m[1];
     while (!$finish) {
         echo $url . "<br/>\n";
         flush();
         $c = new Crawler($url);
         $c->go_to('id="pid_');
         while ($line = $c->readline()) {
             if (Crawler::is_there($line, 'src="')) {
                 $img = Crawler::extract($line, 'src="', '"');
                 $img = str_replace('thumb_100_', @$_GET['big'] ? '' : 'normal__', $img);
                 $num = Crawler::pad(++$number, 3);
                 $filnm = basename($img);
                 $ext = Crawler::cutafter($filnm, '.');
                 // $text = $num . $ext;
                 // preg_match('/\/(\d+\/\d+)\//', $img, $m);
                 // $text = $m[1];
                 echo "<a href='{$img}'>{$text}</a><br/>\n";
                 flush();
             } else {
                 if (Crawler::is_there($line, '</ul>')) {
                     break;
                 }
             }
         }
         $c->go_to('class="pager"');
         $c->readline();
         if (Crawler::is_there($c->curline, 'Pager_next')) {
             $finish = false;
             $url = $host . Crawler::extract($c->curline, '<a rel="next" href="', '"');
         } else {
             $finish = true;
         }
         $c->close();
     }
 }
开发者ID:JerryMaheswara,项目名称:crawler,代码行数:44,代码来源:spider_luscious.php

示例3: str_replace

echo @$prefix;
?>
"><br />
	<input type="submit">
</form>
<?php 
//http://mangahead.com/Manga-English-Scan/History-Strongest-Disciple-Kenichi/Historys-Strongest-Disciple-Kenichi-392-English-Scan
$sitename = "http://mangahead.com";
$pref = @$_POST['base'];
if (!Crawler::is_there($pref, '/index.php/')) {
    $pref = str_replace($sitename . '/Manga', $sitename . '/index.php/Manga', $pref);
}
if (@$base) {
    $finish = false;
    if (Crawler::is_there($pref, '?page=')) {
        $page = Crawler::cutafter($pref, '?page=');
        $pref = Crawler::cutuntil($pref, '?page=');
    } else {
        $page = 1;
    }
    while (!$finish) {
        echo "{$base}<br/>\n";
        flush();
        $c = new Crawler($base);
        $c->go2linewhere('mangaviewer_toppest_navig');
        if (Crawler::is_there($c->curline, '&nbsp;&nbsp;&rsaquo;')) {
            $finish = false;
            $base = $pref . '/?page=' . ++$page;
        } else {
            $finish = true;
        }
开发者ID:JerryMaheswara,项目名称:crawler,代码行数:31,代码来源:mangahead.php

示例4: back_url

 public static function back_url($full)
 {
     return Crawler::cutafter($full, Crawler::site_name($full));
 }
开发者ID:JerryMaheswara,项目名称:crawler,代码行数:4,代码来源:crawler.php


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