Skip to content

Commit 5a84b4e

Browse files
committed
testing j13 endpoint
1 parent ca809e1 commit 5a84b4e

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

index.php

+23-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
if( isset( $_SERVER['REQUEST_URI'] ) )
1313
$uri = substr( $_SERVER['REQUEST_URI'], strlen( W8IO_ROOT ) );
1414
else
15-
$uri = 'tx/eekbucus8sk6qp49ynwysszgmqv3qo8zukjdlhesxrbf';
15+
$uri = 'j13/10';
1616

1717
$js = false;
1818

@@ -25,6 +25,28 @@
2525
$arg3 = $uri[4] ?? false;
2626
$arg4 = $uri[5] ?? false;
2727

28+
if( $address === 'j13' )
29+
{
30+
require_once 'include/RO.php';
31+
$RO = new RO( W8DB );
32+
$q = $RO->db->query( 'SELECT * FROM pts WHERE r2 = 13 ORDER BY r0 DESC LIMIT 100' );
33+
$n = 0;
34+
$json = [];
35+
$max = 100;
36+
if( $f !== false )
37+
$max = min( (int)$f, $max );
38+
foreach( $q as $r )
39+
{
40+
$txkey = $r[1];
41+
$txid = $RO->getTxIdByTxKey( $txkey );
42+
$json[] = $txid;
43+
if( ++$n >= $max )
44+
break;
45+
}
46+
47+
exit( json_encode( $json ) );
48+
}
49+
2850
if( empty( $address ) )
2951
$address = 'GENERATORS';
3052

0 commit comments

Comments
 (0)