Coder Social home page Coder Social logo

git-twitch's Introduction


8bit-heart-mona

git-twitch

(gif created by @pifafu)

This is a service for github and twitch to interact with each other. The use case for this git-twitch interaction between Twitch and GitHub through webhooks. If you are new to Twitch Chat interactions, you can check out my original chatbot, the beybot. In the README you will find further explanation on how Twitch interactions work.

🍴Setup for local development

1. Fork this repo (optional, open a Codespace)

The fastest way to get started is by forking this repo. PRs are welcomed if you find anything missing or unclear.

2. Start a new smee channel - https://smee.io/

smee.io is a Webhook payload delivery service. It receives payloads then sends them to your locally (development) running application. Smee is not meant to be used in production.

smee channel

In your newly forked repo, create a webhook from the repo settings that points it to the new smee channel.

creating a webhook

note: your webhook will need to send json. You will also need to set a secret.

Choose to send selected events and deselect Push events and select Stars. Push events are a bit noisy for testing, Starring the repo is the preferred way to to test that this project is working.

webhook event selection

4. Run npm install smee-client -g in the terminal

The smee client is needed to run this webhook receiver (above). You will need to clone your repo locally (or open a codespace environment) to run the smee client.

npm install smee-client -g
smee -u https://[your create smee channel url from step 2]

5. Start the server

Prior to starting the server you will need to create a new .env file. You can copy the .env.example file. Please make sure to use the secret you set in step 3, this is required for the server to run.

In a different new terminal tab (different from the smee receiver), start the web server with the below commands.

npm install
npm start

If you wish to run the server in development mode you can also run the following command.

npm run start:watch

6. Add browser source plugin

OBS Studio

OBS Studio is a free and open-source software for live-streaming and screen recording. This walk-through will show OBS Studio and consult your platform's documentation or community on how to add browser source plugins.

Browser Source plugins When you set up an out of the box alert or chat system, like Streamlabs, they require you to add something called a Browser Source plugin. To do this, you add the URL pointing to the plugin, provided in the Streamlabs dashboard. This is the backbone of most streaming interactions on Twitch. Browser source plugins are HTML, CSS, and some JavaScript—so basically webpages.

In OBS add a new source to the Scene of your choosing. OBS Studio has a few different source options, but choose Browser and proceed with adding browser source, using your deployed localhost URL (http://localhost:3000). Keep in this is setup for development purposes. You will want to deploy this to a production ready server to use.

browser soource setup in obs

One thing to keep in mind, OBS will be using a cached version of the site at the moment you add the browser plugin. If you make updates, you will need to clear the "Refresh cache of current page" button (I spent a lot of time not knowing that existed).

cache refresh

🚀 Deploy this

to be continued

git-twitch's People

Contributors

bdougie avatar mishmanners avatar lyraddigital avatar jasonericdavis avatar

Watchers

James Cloos 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.