199 >
200 </meta>
201 <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js">
202 </script>
203 </head>
57 function route($uri, $method) {
58 switch ($uri) {
59 case '/api':
60 if ($method === 'POST') {
61 header('Content-Type: application/json');
83 const form = event.target;
84 const formData = new FormData(form);
85 const response = await fetch('/api', {
86 method: 'POST',
87 headers: {
57 function route($uri, $method) {
58 switch ($uri) {
59 case '/api':
60 if ($method === 'POST') {
61 header('Content-Type: application/json');
83 const form = event.target;
84 const formData = new FormData(form);
85 const response = await fetch('/api', {
86 method: 'POST',
87 headers: {
1Serve a REST API in PHP syntax using php-wasm and Val Town.
1Serve a REST API in PHP syntax using php-wasm and Val Town.
13## Authentication
14
15Login to your SQLite Explorer with [password authentication](https://www.val.town/v/pomdtr/password_auth) with your [Val Town API Token](https://www.val.town/settings/api) as the password.
16
17## Todos / Plans
27 <head>
28 <title>SQLite Explorer</title>
29 <link rel="preconnect" href="https://fonts.googleapis.com" />
30
31 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
32 <link
33 href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap"
34 rel="stylesheet"
35 />
1// This val provides an HTML interface for uploading a CSV file of URLs, validates them,
2// and returns a downloadable CSV file with the results.
3// It uses the Fetch API to check each URL's status and generates a CSV report.
4// We'll use the built-in URL constructor for basic URL validation and the native fetch for HTTP requests.
5// The UI is now styled using Tailwind CSS and shadcn UI components for a more polished look.
7 channelId: string;
8}) => {
9 const baseUrl = `https://api.are.na/v2/channels/${channelId}/contents`;
10 let allContents = [];
11 let hasMore = true;
12 let currentPage = 1;
13
14 // Iterate through pages, since the Are.na API seems to be missing info on total pages
15 while (hasMore) {
16 const pagePromises = [];
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO