اربط موقعك أو تطبيقك أو بوتك بمحتوى CCRAFT SPACE — سكربتات، مستخدمون، إحصائيات.
// JavaScript — Fetch const res = await fetch('https://ccraft-space-scripts-default-rtdb.firebaseio.com/scripts.json'); const data = await res.json(); // data = { "-scriptId1": { title, code, category, ... }, ... } const scripts = Object.entries(data).map(([id, s]) => ({ id, ...s })); console.log(scripts);
# Python — requests import requests url = 'https://ccraft-space-scripts-default-rtdb.firebaseio.com/scripts.json' data = requests.get(url).json() for script_id, script in data.items(): print(script_id, script['title'])
curl https://ccraft-space-scripts-default-rtdb.firebaseio.com/scripts.json
📦 الـ Response:
{
"-NxK1abc": {
"title": "Speed Hack",
"code": "game.Players.LocalPlayer...",
"category": "game",
"author": "anas",
"likes": 42,
"rating": 18.5,
"votes": 5,
"map": "Jailbreak",
"timestamp":1704067200000
}
}
const id = "-NxK1abc"; // ID السكربت const res = await fetch( `https://ccraft-space-scripts-default-rtdb.firebaseio.com/scripts/${id}.json` ); const script = await res.json(); console.log(script.title, script.code);
script_id = "-NxK1abc" url = f'https://ccraft-space-scripts-default-rtdb.firebaseio.com/scripts/{script_id}.json' script = requests.get(url).json() print(script['title'])
| البارامتر | النوع | الوصف | مثال |
|---|---|---|---|
| orderBy | string | الحقل للترتيب | "category" |
| equalTo | string | فلتر بقيمة | "game" |
| limitToFirst | number | عدد النتائج (من البداية) | 10 |
| limitToLast | number | عدد النتائج (من النهاية) | 5 |
// أحدث 10 سكربتات const url = 'https://ccraft-space-scripts-default-rtdb.firebaseio.com/scripts.json' + '?orderBy="timestamp"&limitToLast=10'; const data = await fetch(url).then(r => r.json()); // سكربتات Game فقط const url2 = 'https://ccraft-space-scripts-default-rtdb.firebaseio.com/scripts.json' + '?orderBy="category"&equalTo="game"';
const uid = "abc123xyz"; const user = await fetch( `https://ccraft-space-scripts-default-rtdb.firebaseio.com/users/${uid}.json` ).then(r => r.json()); // user.points → النقاط // user.badges → البادجات // user.avatar → بيانات الشخصية
import requests from telegram import Update from telegram.ext import Application, CommandHandler, ContextTypes BASE = "https://ccraft-space-scripts-default-rtdb.firebaseio.com" async def top_scripts(update: Update, ctx: ContextTypes.DEFAULT_TYPE): data = requests.get(f"{BASE}/scripts.json").json() scripts = sorted(data.values(), key=lambda s: s.get('likes', 0), reverse=True)[:5] msg = "🏆 أكثر 5 سكربتات لايكات:\n\n" for i, s in enumerate(scripts, 1): msg += f"{i}. {s['title']} — 👍 {s.get('likes',0)}\n" await update.message.reply_text(msg) app = Application.builder().token("YOUR_TOKEN").build() app.add_handler(CommandHandler("top", top_scripts)) app.run_polling()
async function loadCCraftScripts() { const BASE = "https://ccraft-space-scripts-default-rtdb.firebaseio.com"; const data = await fetch(`${BASE}/scripts.json?orderBy="timestamp"&limitToLast=6`) .then(r => r.json()); const scripts = Object.entries(data) .map(([id, s]) => ({ id, ...s })) .sort((a, b) => b.timestamp - a.timestamp); const container = document.getElementById('scripts-container'); scripts.forEach(s => { container.innerHTML += ` <div class="card"> <h3>${s.title}</h3> <p>👍 ${s.likes || 0} | 📁 ${s.category}</p> <a href="https://ccraftspace.ddnsking.com/script.html?id=${s.id}"> عرض السكربت → </a> </div> `; }); } loadCCraftScripts();
const { Client, GatewayIntentBits } = require('discord.js'); const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages] }); const BASE = "https://ccraft-space-scripts-default-rtdb.firebaseio.com"; client.on('messageCreate', async msg => { if (!msg.content.startsWith('!ccraft')) return; const data = await fetch(`${BASE}/scripts.json`).then(r => r.json()); const scripts = Object.values(data) .sort((a, b) => (b.likes || 0) - (a.likes || 0)) .slice(0, 3); let reply = "**🚀 CCRAFT SPACE — أحدث السكربتات:**\n\n"; scripts.forEach((s, i) => { reply += `${i+1}. **${s.title}** — 👍 ${s.likes || 0}\n`; }); reply += `\n🌐 ${"https://ccraftspace.ddnsking.com"}`; msg.reply(reply); }); client.login('YOUR_DISCORD_TOKEN');