定制 huement/statamic-ytlistr 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

huement/statamic-ytlistr

最新稳定版本:v1.0.3

Composer 安装命令:

composer require huement/statamic-ytlistr

包简介

Statamic addon for syncing YouTube videos to a local database

README 文档

README

A Statamic addon that syncs YouTube videos from a channel to your local database and provides Antlers tags to display them.

Control Panel Interface Manage your YouTube videos directly from the Statamic Control Panel

Features

  • 🎥 Sync YouTube videos from any channel
  • 📊 View video stats (views, likes, duration)
  • 🏷️ Easy-to-use Antlers tags for frontend display
  • 🔄 Manual or automated syncing
  • 💾 Local database storage for fast access
  • 🎨 Clean Control Panel interface

Installation

You can install the package via Composer:

composer require huement/statamic-ytlistr

The package will automatically register itself with Statamic.

Requirements

  • PHP ^8.1
  • Statamic CMS ^5.0

Configuration

Add these variables to your .env file:

YOUTUBE_API_KEY=your_youtube_api_key
YOUTUBE_CHANNEL_ID=your_youtube_channel_id
YOUTUBE_MAX_RESULTS=50

Usage

Sync Videos

Via Control Panel:

  • Navigate to Tools > YouTube Listr
  • Click "Sync Videos from YouTube"

Via Command Line:

php artisan ytlistr:fetch
php artisan ytlistr:fetch --limit=100

Antlers Tags

Frontend Display Example Display your YouTube videos beautifully on the frontend

List all videos:

{{ yt_listr }}
    <h3>{{ title }}</h3>
    <img src="{{ thumbnail_url }}" alt="{{ title }}">
    <p>{{ description }}</p>
    <a href="{{ youtube_url }}">Watch on YouTube</a>
{{ /yt_listr }}

Limit results:

{{ yt_listr limit="5" }}
    <div>{{ title }}</div>
{{ /yt_listr }}

Get latest video:

{{ yt_listr:latest }}
    <h2>{{ title }}</h2>
    <iframe src="{{ embed_url }}" frameborder="0" allowfullscreen></iframe>
{{ /yt_listr:latest }}

Get video count:

Total videos: {{ yt_listr:count }}

Available Data

Each video provides:

  • id - Database ID
  • video_id - YouTube video ID
  • title - Video title
  • description - Video description
  • thumbnail_url - Thumbnail image URL
  • published_at - Publication date
  • duration - Duration in seconds
  • duration_formatted - Human-readable duration (MM:SS)
  • view_count - Number of views
  • like_count - Number of likes
  • comment_count - Number of comments
  • channel_id - YouTube channel ID
  • channel_title - Channel name
  • youtube_url - Full YouTube URL
  • embed_url - YouTube embed URL

Credits

Created and sponsored by Huement.com - A software studio creating awesome content and exceptional web experiences.

Links

License

MIT

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-04