• Stars
    star
    130
  • Rank 277,575 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 2 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Workflow for displaying recent YouTube videos as SVG cards in your readme

GitHub Readme YouTube Cards

Workflow for displaying recent YouTube videos as SVG cards in your readme

Basic Usage

  1. Add the following snippet to your markdown file where you want the cards to appear.
<!-- BEGIN YOUTUBE-CARDS -->
<!-- END YOUTUBE-CARDS -->
  1. In your repo, create a .github folder and inside create a folder named workflows if it does not exist. Then create a file in your .github/workflows/ folder and give it a name such as youtube-cards.yml with the following contents.
name: GitHub Readme YouTube Cards
on:
  schedule:
    # Runs every hour, on the hour
    - cron: "0 * * * *"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    # Allow the job to commit to the repository
    permissions:
      contents: write
    # Run the GitHub Readme YouTube Cards action
    steps:
      - uses: DenverCoder1/github-readme-youtube-cards@main
        with:
          channel_id: UCipSxT7a3rn81vGLw9lqRkg
  1. Make sure to change the channel_id to your YouTube channel ID.

  2. The cron expression in the example above is set to run at the top of every hour. The first time, you may want to trigger the workflow manually.

  3. You're done! Star the repo and share it with friends! โญ

See below for advanced configuration.

Live Example

GitHub Star Swag Unboxing and Giveaways How To Self-Host GitHub Readme Streak Stats on Vercel Automatically Deploy to Fly.io with GitHub Actions Hosting a Python Discord Bot for Free with Fly.io Making a Wordle Clone Discord Bot with Python (Nextcord) Run Open Source Code in Seconds with GitPod

Advanced Configuration

See action.yml for full details.

Check out the Wiki for frequently asked questions.

Inputs

Option Description Default
channel_id The channel ID to use for the feed ๐Ÿ“บ Required
lang The locale for views and timestamps ๐Ÿ’ฌ "en"
comment_tag_name The text in the comment tag for replacing content "YOUTUBE-CARDS"
youtube_api_key The API key to use for features marked with ๐Ÿ”‘ ""
max_videos The maximum number of videos to display 6
base_url The base URL to use for the cards "https://ytcards.demolab.com/"
card_width The width of the SVG cards in pixels 250
border_radius The border radius of the SVG cards 5
background_color The background color of the SVG cards "#0d1117"
title_color The color of the title text "#ffffff"
stats_color The color of the stats text "#dedede"
theme_context_light JSON object with light mode colors ๐ŸŽจ "{}"
theme_context_dark JSON object with dark mode colors ๐ŸŽจ "{}"
max_title_lines The maximum number of lines to use for the title 1
show_duration ๐Ÿ”‘ Whether to show the duration of the videos "false"
author_name The name of the commit author "GitHub Actions"
author_email The email address of the commit author "41898282+github-actions[bot]@users.noreply.github.com"
commit_message The commit message to use for the commit "docs(readme): Update YouTube cards"
readme_path The path to the Markdown or HTML file to update "README.md"
output_only Whether to skip writing to the readme file "false"
output_type The output syntax to use ("markdown" or "html") "markdown"

๐Ÿ“บ A Channel ID is required. See How to Locate Your Channel ID in the wiki for more information.

๐Ÿ”‘ Some features require a YouTube API key. See Setting Up the Action with a YouTube API Key in the wiki for more information.

๐ŸŽจ See Setting Theme Contexts for Light and Dark Mode in the wiki for more information.

๐Ÿ’ฌ See this directory for a list of locales with the word "views" translated. The timestamps will still be translated using Babel even if a translation file is not present. See issue #48 for info on contributing translations.

Outputs

Output Description
markdown The generated Markdown or HTML used for updating the README file
committed Whether the action has created a commit (true or false)
commit_long_sha The full SHA of the commit that has just been created
commit_sha The short 7-character SHA of the commit that has just been created
pushed Whether the action has pushed to the remote (true or false)

See Using the Markdown as an Action Output for more information.

Example Workflow

This is an advanced example showing the available options. All options are optional except channel_id.

name: GitHub Readme YouTube Cards
on:
  schedule:
    # Runs every hour, on the hour
    - cron: "0 * * * *"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    # Allow the job to commit to the repository
    permissions:
      contents: write
    # Run the GitHub Readme YouTube Cards action
    steps:
      - uses: DenverCoder1/github-readme-youtube-cards@main
        with:
          channel_id: UCipSxT7a3rn81vGLw9lqRkg
          lang: en
          comment_tag_name: YOUTUBE-CARDS
          youtube_api_key: ${{ secrets.YOUTUBE_API_KEY }} # Configured in Actions Secrets (see Wiki)
          max_videos: 6
          base_url: https://ytcards.demolab.com/
          card_width: 250
          border_radius: 5
          background_color: "#0d1117"
          title_color: "#ffffff"
          stats_color: "#dedede"
          theme_context_light: '{ "background_color": "#ffffff", "title_color": "#24292f", "stats_color": "#57606a" }'
          theme_context_dark: '{ "background_color": "#0d1117", "title_color": "#ffffff", "stats_color": "#dedede" }'
          max_title_lines: 2
          show_duration: true # Requires YouTube API Key (see Wiki)
          author_name: GitHub Actions
          author_email: 41898282+github-actions[bot]@users.noreply.github.com
          commit_message: "docs(readme): Update YouTube cards"
          readme_path: README.md
          output_only: false
          output_type: markdown

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.

Make sure your request is meaningful and you have tested the app locally before submitting a pull request.

Please check out our contributing guidelines for more information on how to contribute to this project.

๐Ÿ™‹โ€โ™‚๏ธ Support

๐Ÿ’™ If you like this project, give it a โญ and share it with friends!

Youtube Sponsor with Github

โ˜• Buy me a coffee

More Repositories

1

readme-typing-svg

โšก Dynamically generated, customizable SVG that gives the appearance of typing and deleting text for use on your profile page, repositories, or website.
PHP
4,230
star
2

github-readme-streak-stats

๐Ÿ”ฅ Stay motivated and show off your contribution streak! ๐ŸŒŸ Display your total contributions, current streak, and longest streak on your GitHub profile README
PHP
3,842
star
3

custom-icon-badges

๐Ÿ›ก Allows users to more easily use Octicons and their own icons and logos on shields.io badges
TypeScript
536
star
4

DenverCoder1

Jonah Lawrence's Profile README
496
star
5

latex-gboard-dictionary

โŒจ Importable dictionary for typing math symbols more easily on your Android phone by using keyboard shortcuts inspired by LaTeX
332
star
6

minimalistic-wallpaper-collection

Minimalistic, flat art, and colorful, digital nature wallpapers and an API for randomly selecting them
PHP
223
star
7

weather-app-tutorial

Weather app written in HTML, CSS, and JavaScript using the APIs for fetching weather and geolocation information.
HTML
149
star
8

unedit-for-reddit

Creates a link next to edited and deleted Reddit comments to show the original from before it was edited. The unedited comment gets displayed inline.
JavaScript
64
star
9

unicode-formatter

Convert portions of text to fancy text using unicode fonts for use on Twitter and other sites that don't support rich text
JavaScript
56
star
10

table2ascii

An intuitive and type-safe Python library for converting lists to fancy ASCII tables for displaying in the terminal or code-blocks
Python
54
star
11

doxygen-github-pages-action

GitHub Action for deploying Doxygen documentation to a GitHub pages branch
50
star
12

github-readme-youtube-stats

Youtube stats badges for your Github profile README. Displays the total number of subscribers or the view count for your channel.
PHP
47
star
13

tutorial-discord-bot

Example Discord bot for YouTube tutorials
Python
31
star
14

dev-pro-tips-bot

Bot for the Dev Pro Tips Discord server
Python
27
star
15

Simple-View-Counter

Simple view counter for websites and Github READMEs.
PHP
25
star
16

Responsive-Birthday-Card

Responsive Card with HTML and CSS + YouTube tutorial
CSS
22
star
17

readme-download-button-action

GitHub Action workflow configuration for keeping a direct download link to the latest version on your repo's readme
18
star
18

dynamic-badge-formatter

Format dynamic shields.io badges to look consistent using formatters for metrics, versions, and more
JavaScript
16
star
19

discord-bot-template

Nextcord (discord.py fork) template for simple and maintainable Discord Bot creation
Python
16
star
20

Advent-of-Code-2021

Advent of Code Solutions 2021 in Python
Python
13
star
21

discord-wordle-clone

Discord bot to play a Wordle-inspired word puzzle game entirely within Discord
Python
12
star
22

jct-discord-bot

Bot for JCT ESP CompSci Discord Server
Python
11
star
23

unit-converter-albert-ext

Albert launcher extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecular substance, and more
Python
9
star
24

Advent-of-Code-2020---Javascript

Advent of Code 2020 Solutions in JavaScript
JavaScript
6
star
25

play-lichess

Module for creating match links on Lichess that players can join
Python
5
star
26

Tic-Tac-Toe

Tic-Tac-Toe in Javascript
JavaScript
5
star
27

discord-voice-activities-bot

A simple bot for launching Discord's activities in voice channels using Nextcord
Python
4
star
28

Tag-Owl-Reddit-Bot

Reddit bot to tag long lists of users
Python
4
star
29

professor-vector-discord-bot

Discord bot for r/Arithmancy - A reddit feed bot and more!
Python
4
star
30

dotfiles

Jonah Lawrence's dotfiles for computer configurations ๐Ÿ‘จโ€๐Ÿ’ป
Shell
3
star
31

countdown

Website to display a countdown timer to a specified date.
PHP
3
star
32

timezone-convert-albert-ext

Albert launcher extension for converting between timezones
Python
3
star
33

anagram-solver

Anagram solver to find words in multi-word anagrams. Includes Harry Potter word dictionary.
HTML
3
star
34

php-simple-crud-api

Simple API for storing and retrieving labeled data (grouped key-value pairs)
PHP
3
star
35

weasley-chess-bot

Discord bot for Weasley's Chess Club server
Python
3
star
36

docstring-utils

Parser and checker for Numpy, Sphinx, and Google-style docstrings
Python
3
star
37

dice-roll-albert-ext

Albert launcher extension for rolling dice.
Python
2
star
38

jack-man

PAC-MAN clone written in Jack Language
2
star
39

facebook-group-feed

Send new messages from public Facebook groups to a Discord channel
Python
2
star
40

saucerobot

Reddit bot for fetching image sources
Python
2
star
41

popup-for-google-tasks

Browser extension for opening Google Tasks in a popup window
JavaScript
2
star
42

C-Workshop

Exercise work for C Workshop course August 2021
C
2
star
43

Jack-to-Hack-Compiler-Ceylon

Jack to Hack Compiler in Ceylon completed for Fundamentals of Programming Languages Course, 2020-2021.
Ceylon
1
star
44

CPP-Console-2048

C++
1
star
45

Connect-4-AI

Connect 4 with an AI using the Minimax algorithm
Python
1
star
46

Java-Ray-Tracing-Project

3D-Renderer with Ray Tracing completed for Introduction to Software Engineering Course, Spring 2021
Java
1
star
47

hogwarts-ghosts

Bot for the Hogwarts Ghosts Discord server with features for ticket channels and archiving
Python
1
star
48

give-and-take-bot

Bot for validating messages in the Give and Take game
Python
1
star
49

chess-piece-classifier

Demonstration of Tensorflow Lite for classifying images of chess pieces
JavaScript
1
star
50

godel-program-converter

Program to convert a program encoding based on its Gรถdel number to ๐’ฎ Language (S Language) or convert an ๐’ฎ Language program to it's program number
Python
1
star
51

CPP-Yaniv

Yaniv Card Game written in C++
C++
1
star
52

DarkReader-API-Sample-Code

Sample usage of the DarkReader package for enabling dark mode on your website.
HTML
1
star
53

Jonah-Villas-WPF-Project

Property management system allowing hosts to list their rental homes and customers to search for properties and make requests. Project in WPF, C# .NET Framework for the 2019-2020 school year.
C#
1
star