ponzu-gif-cdn
v1.0.3
Published
Ponzu GIF CDN - Anime, manga ve gaming içerikleri için modern CDN API
Maintainers
Readme
🎨 GIF CDN API
Modern, hızlı ve kolay kullanımlı GIF & Medya CDN API sistemi. Kategorilere göre random medya çekin, dosyalarınızı yükleyin ve projenize kolayca entegre edin.
✨ Özellikler
- 🚀 Yıldırım hızında CDN
- 🎯 Kategori & alt kategori desteği
- 🎲 Random medya çekme
- 📤 Kolay dosya yükleme
- 🔒 API key authentication
- 💪 TypeScript desteği
- 📦 Zero dependencies (sadece axios)
📦 Kurulum
npm install ponzu-gif-cdn
# veya
yarn add ponzu-gif-cdn
# veya
bun add ponzu-gif-cdn🚀 Hızlı Başlangıç
Basit Kullanım
import { getRandomGif, setDefaultConfig } from 'ponzu-gif-cdn';
// API URL'ini ayarla (opsiyonel)
setDefaultConfig({
baseUrl: 'https://cdnekle.animesaga.com.tr/api'
});
// Random GIF çek
const result = await getRandomGif({
category: 'sfw',
subCategory: 'hug',
limit: 5
});
console.log(result.files);Class Kullanımı
import { GifCdnApi } from 'ponzu-gif-cdn';
const api = new GifCdnApi({
baseUrl: 'https://cdnekle.animesaga.com.tr/api',
apiKey: 'your-api-key' // Sadece upload için gerekli
});
// Random GIF'ler
const gifs = await api.getRandom({
category: 'nsfw',
subCategory: 'hentai',
limit: 10
});
// Tek bir random GIF
const singleGif = await api.getRandomOne({
category: 'sfw',
subCategory: 'kiss'
});
console.log(singleGif?.url);📖 API Dokümantasyonu
getRandom(options)
Random medya dosyaları çeker.
Parametreler:
category(string, opsiyonel): Kategori slug'ı (örn: 'sfw', 'nsfw', 'other')subCategory(string, opsiyonel): Alt kategori slug'ı (örn: 'hug', 'kiss', 'hentai')limit(number, opsiyonel): Kaç dosya çekileceği (varsayılan: 10, max: 50)type(string, opsiyonel): Dosya tipi filtresi (örn: 'gif', 'webp', 'mp4')
Dönüş:
{
success: true,
count: 5,
files: [
{
id: 1,
filename: "example.gif",
url: "https://cdn.example.com/uploads/sfw/hug/example.gif",
mime_type: "image/gif",
width: 500,
height: 500,
created_at: "2025-01-01T00:00:00.000Z"
}
]
}Örnek:
const result = await api.getRandom({
category: 'sfw',
subCategory: 'hug',
limit: 5,
type: 'gif'
});getRandomOne(options)
Tek bir random medya dosyası çeker.
Örnek:
const gif = await api.getRandomOne({
category: 'sfw'
});
if (gif) {
console.log(gif.url);
}upload(options)
Dosya yükler (API key gerektirir).
Parametreler:
file(File | Buffer, opsiyonel): Yüklenecek dosyaurl(string, opsiyonel): URL'den yüklemecategory(string, opsiyonel): KategorisubCategory(string, opsiyonel): Alt kategori
Örnek:
const api = new GifCdnApi({
apiKey: 'your-api-key'
});
// URL'den yükle
const result = await api.upload({
url: 'https://example.com/image.gif',
category: 'sfw',
subCategory: 'hug'
});
console.log(result.file.url);getCategories()
Tüm kategorileri ve alt kategorileri getirir.
Örnek:
const { categories } = await api.getCategories();
categories.forEach(cat => {
console.log(cat.name, cat.is_nsfw);
cat.sub_categories.forEach(sub => {
console.log(' -', sub.name);
});
});🎯 Kullanım Senaryoları
Discord Bot
import { getRandomGifOne } from 'ponzu-gif-cdn';
import { Client } from 'discord.js';
const client = new Client({ intents: [] });
client.on('messageCreate', async (message) => {
if (message.content === '!hug') {
const gif = await getRandomGifOne({
category: 'sfw',
subCategory: 'hug'
});
if (gif) {
message.reply(gif.url);
}
}
});React Component
import { useEffect, useState } from 'react';
import { getRandomGif } from 'ponzu-gif-cdn';
function RandomGifGallery() {
const [gifs, setGifs] = useState([]);
useEffect(() => {
async function fetchGifs() {
const result = await getRandomGif({
category: 'sfw',
limit: 9
});
setGifs(result.files);
}
fetchGifs();
}, []);
return (
<div className="grid grid-cols-3 gap-4">
{gifs.map(gif => (
<img key={gif.id} src={gif.url} alt={gif.filename} />
))}
</div>
);
}Express API
import express from 'express';
import { getRandomGif } from 'ponzu-gif-cdn';
const app = express();
app.get('/random-gif', async (req, res) => {
const result = await getRandomGif({
category: req.query.category as string,
limit: 1
});
res.json(result.files[0]);
});
app.listen(3000);🗂️ Mevcut Kategoriler
SFW (Safe for Work)
hug- Sarılma GIFlerikiss- Öpücük GIFleriecchi- Hafif çekici içerikcosplay- Cosplay fotoğraflarıabstract- Soyut içerikler
NSFW (Not Safe for Work) 🔞
boobs- Göğüs içerikleriblowjob- Oral içeriklerhentai- Hentai içeriklerecchi- Ecchi içeriklerass- Kalça içeriklerianal- Anal içerikler
Other
- Genel içerikler
🔒 Authentication
Public API endpoint'leri (örn: getRandom) için authentication gerekmez.
Upload işlemleri için API key gereklidir:
const api = new GifCdnApi({
apiKey: 'your-api-key-here'
});🌐 REST API Kullanımı
NPM paketi kullanmak istemiyorsanız, doğrudan REST API'yi kullanabilirsiniz:
# Random GIF
curl "https://cdnekle.animesaga.com.tr/api/random?category=sfw&sub_category=hug&limit=5"
# Upload (API key gerekli)
curl -X POST \
-H "x-api-key: your-api-key" \
-F "[email protected]" \
-F "category=sfw" \
-F "sub_category=hug" \
"https://cdnekle.animesaga.com.tr/api/upload"
# Kategorileri getir
curl "https://cdnekle.animesaga.com.tr/api/categories"📝 Lisans
MIT License - Açık kaynak ve ücretsiz kullanım.
🤝 Katkıda Bulunma
Pull request'ler memnuniyetle karşılanır! Büyük değişiklikler için lütfen önce bir issue açın.
📧 Destek
Sorularınız için GitHub Issues kullanabilirsiniz.
