This commit is contained in:
biglyderv 2025-02-07 02:52:53 -05:00
parent 5e7930c327
commit fdd4b6c646
2 changed files with 3 additions and 1 deletions

View file

@ -16,6 +16,7 @@ Create a file named ``test_secret.php`` in the ``libs`` folder:
``` ```
<?php <?php
$db = new PDO('pgsql:host=YOUR_HOST;dbname=YOUR_DB', 'YOUR_USER', 'YOUR_PASS'); $db = new PDO('pgsql:host=YOUR_HOST;dbname=YOUR_DB', 'YOUR_USER', 'YOUR_PASS');
$node_backend = 'https://your.api.com'; // from https://git.dervland.net/biglyderv/bigly-caret
?> ?>
``` ```
Initialize the database from the ``scripts`` folder. Initialize the database from the ``scripts`` folder.

View file

@ -23,7 +23,8 @@ page_header();
<?php <?php
function get_handler() function get_handler()
{ {
$api = file_get_contents("https://nbg.dervland.net/node/top?ref=" . $_GET['username']); global $node_backend;
$api = file_get_contents($node_backend . "/top?ref=" . $_GET['username']);
$pr = json_decode($api); $pr = json_decode($api);
foreach ($pr as $usern => $rr) { ?> foreach ($pr as $usern => $rr) { ?>