Fast JSON API - Recent Pastes Endpoint
Fast JSON API - Recent Pastes Endpoint
=====================================
<?php
header('Content-Type: application/json');
$pdo = new PDO('mysql:host=localhost;dbname=pastetext', $user, $pass);
$stmt = $pdo->query('SELECT id,title FROM pastes WHERE visible=1 ORDER BY created_at DESC LIMIT 10');
$pastes = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo json_encode(['data' => $pastes]);
?>
Featured
Advertisement
Category
Action