Back to list
AppleLamps

refresh-content

by AppleLamps

0🍴 0📅 Jan 7, 2026

SKILL.md


name: refresh-content description: Guide content sync operations for X posts and YouTube videos. Use when user mentions "refresh feed", "sync posts", "update videos", "fetch latest", or asks about content pipeline. allowed-tools: Read, Glob, Grep, Bash

Refresh Content

Guide for refreshing X (Twitter) and YouTube content via admin endpoints.

Instructions

  1. Check current cache status:

    • Read src/lib/db.ts for getLastFetchedAt* functions
    • Query database for last fetch timestamps
  2. Available refresh endpoints (POST requests):

    X Posts:

    curl -X POST http://localhost:3000/api/admin/refresh/x-posts
    

    X Mentions:

    curl -X POST http://localhost:3000/api/admin/refresh/x-mentions
    

    YouTube Videos:

    curl -X POST http://localhost:3000/api/admin/refresh/youtube-videos
    

    Video Summaries (requires OpenAI):

    curl -X POST http://localhost:3000/api/admin/refresh/video-summaries
    
  3. For production, use the deployed URL instead of localhost

  4. Check responses for success/count:

    { "success": true, "message": "Refreshed 15 posts", "count": 15 }
    

Data Flow

  1. Admin triggers POST to refresh endpoint
  2. API calls external source (XAI for X, YouTube API)
  3. Data parsed and validated
  4. Upserted to database with fetched_at timestamp
  5. Frontend fetches from /api/x/posts or /api/youtube/videos

Troubleshooting

No data returned:

  • Check API keys in .env.local: XAI_API_KEY, YOUTUBE_API_KEY
  • Verify rate limits not exceeded

JSON parse errors (X posts):

  • XAI sometimes returns malformed JSON
  • Check src/lib/xai.ts for sanitization logic

YouTube filtering:

  • Shorts (<=180s) and livestreams are automatically excluded
  • See src/lib/youtube.ts for filter logic

Examples

  • "Refresh the X posts feed"
  • "Sync latest YouTube videos"
  • "Check when content was last updated"

Guardrails

  • Do NOT purge data without explicit confirmation
  • Run one refresh at a time to avoid rate limits
  • Check environment variables are set before calling endpoints
  • Never expose API keys in logs or responses

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon