streamlined
Build and push / Pulling repo on server (push) Successful in 2s Details

This commit is contained in:
Chris 2023-12-23 19:53:52 +01:00
parent 807aa70719
commit b6b82cae41
1 changed files with 25 additions and 27 deletions

View File

@ -1,43 +1,41 @@
<?php
if(!file_exists('tmp/ergebnisse.html'))
{
$ergebnisse = file_get_contents('https://www.dognow.at/ergebnisse/');
file_put_contents('tmp/ergebnisse.html', $ergebnisse);
}
$GLOBALS['db'] = new SQLite3('data.db');
if(!$GLOBALS['db']) exit("Error loading database");
//389-7625.pdf.csv
// analyzeResultCSV('tmp/csv/389-7637.pdf.csv',7637,389);
// exit();
// if(!file_exists('tmp/ergebnisse.html'))
// {
// $ergebnisse = file_get_contents('https://www.dognow.at/ergebnisse/');
// file_put_contents('tmp/ergebnisse.html', $ergebnisse);
// }
$html = file_get_contents('tmp/ergebnisse.html');
// $html = file_get_contents('tmp/ergebnisse.html');
$dom = new DOMDocument;
$dom->loadHTML($html);
// $dom = new DOMDocument;
// $dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$query = '//ul[@class="pagination"]/child::*';
$nodes = $xpath->query($query);
// $xpath = new DOMXPath($dom);
// $query = '//ul[@class="pagination"]/child::*';
// $nodes = $xpath->query($query);
$GLOBALS['pdfs'] = 0;
// $GLOBALS['pdfs'] = 0;
// Loop through the selected nodes
foreach ($nodes as $node) {
// Do something with each node, for example, echo its content
$url = $node->getElementsByTagName('a')[0]->getAttribute('href');
$number = intval($node->nodeValue);
if($number > $last_page){
$last_page = $number;
}
}
// // Loop through the selected nodes
// foreach ($nodes as $node) {
// // Do something with each node, for example, echo its content
// $url = $node->getElementsByTagName('a')[0]->getAttribute('href');
// $number = intval($node->nodeValue);
// if($number > $last_page){
// $last_page = $number;
// }
// }
echo "[i] Found $last_page pages\n";
// echo "[i] Found $last_page pages\n";
//create an array with all pages
$pages = range(1,65);
// //create an array with all pages
// $pages = range(1,65);
// foreach($pages as $page)
// {