📄 REST API Documentation
📌 Distro Download Leaderboard API
Base URL:https://smal82.netsons.org/wp-json/mct/v1/classifica
📝 Descrizione
Questa REST API fornisce una classifica pubblica e aggiornata delle distro scaricate in base al numero di download.
È pensata per essere facilmente integrata in applicazioni web, mobile e software desktop di terze parti.
La risposta è in formato JSON, strutturata per essere semplice da gestire e includere nei propri progetti.
🎯 Funzionalità
✅ Recupera l’elenco dei link magnet più scaricati.
✅ Restituisce i dati ordinati dal più scaricato al meno scaricato.
✅ Formato JSON standard per massima compatibilità.
✅ Accesso pubblico senza autenticazione (facile da integrare).
⚙️ Endpoint
GET /wp-json/mct/v1/classifica
Request URL Completo
https://smal82.netsons.org/wp-json/mct/v1/classifica
Metodo:
GET
📦 Response Example (200 OK)
JSON
{
"Distro": "Ubuntu 22.04 LTS",
"Download": 150
},
{
"Distro": "Fedora 39",
"Download": 100
},
{
"Distro": "Arch Linux",
"Download": 80
}
]
📖 Descrizione dei Campi
| Campo | Tipo | Descrizione |
|---|---|---|
| Distro | string | Il nome della distribuzione |
| Download | integer | Numero totale di download registrati |
✅ Come Usare l’API
Esempi di richieste in vari linguaggi
🟦 cURL
curl -k https://smal82.netsons.org/wp-json/mct/v1/classifica
Se ricevi errori SSL su Windows:
curl -k --ssl-no-revoke https://smal82.netsons.org/wp-json/mct/v1/classifica
🟧 JavaScript (Fetch API)
JavaScript
fetch('https://smal82.netsons.org/wp-json/mct/v1/classifica')
.then(response => response.json())
.then(data => {
console.log('Classifica:', data);
})
.catch(error => console.error('Errore:', error));🟩 jQuery
JavaScript
$.getJSON('https://smal82.netsons.org/wp-json/mct/v1/classifica', function(data) {
console.log('Classifica:', data);
});
🐍 Python (requests)
Python
import requests
url = 'https://smal82.netsons.org/wp-json/mct/v1/classifica'
response = requests.get(url)
if response.status_code == 200:
classifica = response.json()
print('Classifica:', classifica)
else:
print('Errore:', response.status_code)
🐘 PHP (cURL)
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://smal82.netsons.org/wp-json/mct/v1/classifica",
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($curl);
curl_close($curl);
$data = json_decode($response, true);
echo '<pre>';
print_r($data);
echo '</pre>';
?>
🔷 C# (HttpClient)
C#
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
HttpClient client = new HttpClient();
var response = await client.GetAsync("https://smal82.netsons.org/wp-json/mct/v1/classifica");
if (response.IsSuccessStatusCode)
{
string json = await response.Content.ReadAsStringAsync();
Console.WriteLine("Classifica:\n" + json);
}
else
{
Console.WriteLine("Errore: " + response.StatusCode);
}
}
}
🟦 Node.js (Axios)
const axios = require('axios');
axios.get('https://smal82.netsons.org/wp-json/mct/v1/classifica')
.then(response => {
console.log('Classifica:', response.data);
})
.catch(error => {
console.error('Errore:', error);
});
🛠️ Requisiti
- HTTPS richiesto per tutte le chiamate.
- Accesso pubblico, non è richiesta autenticazione.
- I dati vengono restituiti in tempo reale sulla base delle informazioni memorizzate nel database del sito.