20 lines
541 B
PHP
20 lines
541 B
PHP
<?php
|
|
|
|
require_once ('/home/grizzly/store/browser/db.php');
|
|
|
|
$c = curl_init();
|
|
curl_setopt($c, CURLOPT_URL,'https://tilde.team/');
|
|
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
|
|
$data = curl_exec($c);
|
|
curl_close($c);
|
|
|
|
preg_match_all('/<li><a href="\/~(.*)\/" class=\"list-group-item col-xs-6 col-sm-4 col-md-2\">~(.*)<\/a><\/li>/', $data, $matches);
|
|
|
|
foreach ($matches[1] as $user) {
|
|
$stmt = $db->prepare("INSERT INTO `websites` (login_name) VALUES(:login_name)");
|
|
$stmt->bindParam(':login_name', $user);
|
|
$stmt->execute();
|
|
}
|
|
|
|
|
|
?>
|