-
Notifications
You must be signed in to change notification settings - Fork 170
/
91all.php
executable file
·39 lines (34 loc) · 895 Bytes
/
91all.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require 'detailPage.php';
use DiDom\Document;
use DiDom\Query;
function listPage($baseUrl, $min, $max)
{
$currentPage = $min;
while ($currentPage <= $max) {
$url = $baseUrl."&page=".$currentPage;
echo "\n".$url."\n";
try {
$html = getHtml($url);
$listPage = new Document($html);
$list = $listPage->find('.well a');
foreach ($list as $item) {
$title = $item->first('.video-title')->text();
echo "\n".$title."\n";
$itemUrl = $item->getAttribute('href');
echo $itemUrl."\n";
singlePage($itemUrl, $title);
}
} catch (Exception $e) {
echo $e;
}
$currentPage += 1;
}
}
foreach (Config::$all_lists as $page_url => $range) {
if (is_array($range)) {
listPage('http://'.Config::$url.'/v.php?'.$page_url, $range[0], $range[1]);
} else if (is_int($range)) {
listPage('http://'.Config::$url.'/v.php?'.$page_url, $range, $range);
}
}