Rename server.js to results.html
Browse files- results.html +50 -0
- server.js +0 -34
results.html
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="ar" dir="rtl">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>نتائج البحث</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 10 |
+
margin: 0;
|
| 11 |
+
padding: 0;
|
| 12 |
+
background-color: #fff;
|
| 13 |
+
}
|
| 14 |
+
.header {
|
| 15 |
+
background-color: #f8f9fa;
|
| 16 |
+
padding: 15px;
|
| 17 |
+
border-bottom: 1px solid #ddd;
|
| 18 |
+
display: flex;
|
| 19 |
+
align-items: center;
|
| 20 |
+
gap: 20px;
|
| 21 |
+
}
|
| 22 |
+
.header a {
|
| 23 |
+
text-decoration: none;
|
| 24 |
+
color: #4285F4;
|
| 25 |
+
font-weight: bold;
|
| 26 |
+
font-size: 20px;
|
| 27 |
+
}
|
| 28 |
+
.results-wrapper {
|
| 29 |
+
padding: 20px;
|
| 30 |
+
max-width: 1200px;
|
| 31 |
+
margin: 0 auto;
|
| 32 |
+
}
|
| 33 |
+
</style>
|
| 34 |
+
</head>
|
| 35 |
+
<body>
|
| 36 |
+
|
| 37 |
+
<div class="header">
|
| 38 |
+
<a href="index.html">🔍 بحثي</a>
|
| 39 |
+
<!-- يمكن إضافة حقل بحث صغير هنا أيضاً -->
|
| 40 |
+
</div>
|
| 41 |
+
|
| 42 |
+
<div class="results-wrapper">
|
| 43 |
+
<!-- بداية كود Google CSE الإجباري -->
|
| 44 |
+
<script async src="https://cse.google.com/cse.js?cx=75aa960081baa4f0c"></script>
|
| 45 |
+
<div class="gcse-searchresults-only"></div>
|
| 46 |
+
<!-- نهاية كود Google CSE الإجباري -->
|
| 47 |
+
</div>
|
| 48 |
+
|
| 49 |
+
</body>
|
| 50 |
+
</html>
|
server.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
| 1 |
-
const express = require('express');
|
| 2 |
-
const axios = require('axios');
|
| 3 |
-
const app = express();
|
| 4 |
-
const PORT = 3000;
|
| 5 |
-
|
| 6 |
-
// عنوان SearXNG (يمكن أن يكون محلياً أو عاماً)
|
| 7 |
-
const SEARXNG_URL = 'https://searx.perennialte.ch/search';
|
| 8 |
-
|
| 9 |
-
app.use(express.static('public')); // لخدمة ملفات الواجهة (index.html)
|
| 10 |
-
|
| 11 |
-
app.get('/api/search', async (req, res) => {
|
| 12 |
-
const query = req.query.q;
|
| 13 |
-
if (!query) return res.status(400).json({ error: 'missing query' });
|
| 14 |
-
|
| 15 |
-
try {
|
| 16 |
-
// طلب JSON من SearXNG
|
| 17 |
-
const response = await axios.get(SEARXNG_URL, {
|
| 18 |
-
params: {
|
| 19 |
-
q: query,
|
| 20 |
-
format: 'json'
|
| 21 |
-
// يمكن إضافة معاملات أخرى: language, categories, engines...
|
| 22 |
-
},
|
| 23 |
-
timeout: 10000
|
| 24 |
-
});
|
| 25 |
-
|
| 26 |
-
// إعادة البيانات كما هي أو تنسيقها حسب رغبتك
|
| 27 |
-
res.json(response.data);
|
| 28 |
-
} catch (error) {
|
| 29 |
-
console.error(error.message);
|
| 30 |
-
res.status(500).json({ error: 'فشل الاتصال بمحرك البحث' });
|
| 31 |
-
}
|
| 32 |
-
});
|
| 33 |
-
|
| 34 |
-
app.listen(PORT, () => console.log(`الخادم الوسيط يعمل على http://localhost:${PORT}`));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|