Cumfiesta.24.06.16.ryan.reid.the.rise.of.the.cu... Apr 2026
/* Masonry/Grid Feed */ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"> items.map((item, idx) => ( <motion.div key=item.id initial= opacity: 0, y: 20 animate= opacity: 1, y: 0 transition= delay: idx * 0.05 className="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-xl transition" > <div className="relative aspect-video bg-black"> item.contentType === 'VIDEO' ? ( <video src=item.thumbnailUrl className="w-full h-full object-cover" /> ) : ( <img src=item.thumbnailUrl alt=item.title className="w-full h-full object-cover" /> ) <div className="absolute top-2 right-2 bg-black/70 text-white text-xs px-2 py-1 rounded-full"> 🔥 item.trendScore.toFixed(1) trending </div> </div> <div className="p-4"> <h3 className="font-semibold line-clamp-2">item.title</h3> <div className="flex justify-between items-center mt-4"> <button onClick=() => handleLike(item.id) className="flex items-center gap-1 text-gray-600"> item.userLiked ? <HeartSolidIcon className="w-5 h-5 text-red-500" /> : <HeartIcon className="w-5 h-5" /> <span>item.likes</span> </button> <button className="flex items-center gap-1 text-gray-600"> <ChatBubbleLeftIcon className="w-5 h-5" /> <span>23</span> </button> <button className="flex items-center gap-1 text-gray-600"> <ShareIcon className="w-5 h-5" /> <span>item.shares</span> </button> </div> </div> </motion.div> )) </div> loading && <div className="text-center py-8">Loading more trends...</div> <div ref=observerTarget className="h-10" /> </div> );
useEffect(() => fetchTrending(); , [page]);
# backend/services/trending_algorithm.py from datetime import datetime, timezone import math def calculate_trend_score(content, current_time): hours_since_publish = (current_time - content.published_at).total_seconds() / 3600 hours_since_decay_start = (current_time - content.decay_started_at).total_seconds() / 3600
await prisma.$transaction([ prisma.trendingContent.update( where: id: contentId , data: [type === 'like' ? 'likes' : type === 'share' ? 'shares' : 'views']: increment: 1 ), prisma.userInteraction.create( data: userId: req.user.id, contentId, type ) ]); CumFiesta.24.06.16.Ryan.Reid.The.Rise.Of.The.Cu...
return ( <div className="max-w-4xl mx-auto px-4 py-8"> /* Category Pills */ <div className="flex gap-2 overflow-x-auto pb-4 mb-6 sticky top-0 bg-white z-10"> ['All', 'Viral', 'Movies', 'Music', 'Gaming'].map(cat => ( <button key=cat className="px-4 py-2 rounded-full bg-gray-100 hover:bg-gray-200 whitespace-nowrap"> cat </button> )) </div>
def fetch_youtube_trending(): youtube_api_key = os.getenv("YOUTUBE_API_KEY") url = f"https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics&chart=mostPopular®ionCode=US&videoCategoryId=10&key=youtube_api_key" # Category 10 = Music, 24 = Entertainment return videos
# Apply recency bonus if hours_since_publish < 2: score *= 1.5 return round(score, 6) // GET /api/trending/feed router.get('/feed', async (req, res) => { const limit = 20, offset = 0, contentType, category = req.query; const whereClause = {}; if (contentType) whereClause.contentType = contentType; if (category) whereClause.category = category; 'likes' : type === 'share'
@@index([trendScore(sort: Desc)]) @@index([contentType, category])
# Gravity factor (newer content gets boost) gravity = 1.5 if hours_since_publish < 24 else 1.8
# scraper/entertainment_aggregator.py import feedparser from selenium import webdriver def fetch_reddit_trending(): # r/all trending in entertainment reddit_url = "https://www.reddit.com/r/entertainment/top.json?t=day&limit=25" # Use praw library or requests with auth return posts prisma.userInteraction.create( data: userId: req.user.id
# Total interactions interactions = content.views + (content.likes * 2) + (content.shares * 5) + (content.comments * 3)
The Trending Score is calculated every 15 minutes via a background job (Celery/Bull).
score = math.log10(max(interactions, 1)) / ((hours_since_publish + 2) ** gravity)