// Installiere die benötigten Pakete: express, axios, cors
const express = require('express');
const axios = require('axios');
const cors = require('cors');
const app = express();
const PORT = 3000;
app.use(cors());
async function getGoogleTrends(region) {
try {
// Beispiel-API-Endpunkt (ersetzen mit einer echten API, z. B. Google Trends)
const response = await axios.get(`https://api.trends.example.com/trends?region=${region}`);
return response.data;
} catch (error) {
console.error(error);
return [];
}
}
app.get('/trends', async (req, res) => {
const region = req.query.region || 'US'; // Standard: USA
const trends = await getGoogleTrends(region);
res.json(trends);
});
app.listen(PORT, () => {
console.log(`Server läuft auf http://localhost:${PORT}`);
});
Trends Dashboard
Trends in Deutschland und den USA
| # |
Thema |
Traffic-Zuwachs (%) |
Uhrzeit |
Kommentare
Kommentar veröffentlichen