GithubHelp home page GithubHelp logo

lmlouis / github-readme-youtube-cards Goto Github PK

View Code? Open in Web Editor NEW

This project forked from denvercoder1/github-readme-youtube-cards

0.0 0.0 0.0 260 KB

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

Home Page: https://ytcards.demolab.com

License: MIT License

JavaScript 3.08% Python 76.29% CSS 5.01% HTML 15.62%

github-readme-youtube-cards's Introduction

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:
  deploy:
    runs-on: ubuntu-latest
    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

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 Custom Help Commands [#2] Select Menus - Python Discord Bot Custom Help Commands [#1] Embeds - Python Discord Bot

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 relative time text "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
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 ๐ŸŽจ "{}"
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.

Outputs

Output Description
markdown The generated Markdown or HTML used for updating the README file

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:
  deploy:
    runs-on: ubuntu-latest
    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
          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" }'
          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

github-readme-youtube-cards's People

Contributors

denvercoder1 avatar github-actions[bot] avatar dependabot[bot] avatar vyvy-vi avatar pre-commit-ci[bot] avatar chinmaymhatre avatar mehdigrn-code avatar sohaib-50 avatar yugal41735 avatar anonimak avatar orama254 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.