livemd

package module
v0.0.0-...-fa8de75 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 11 Imported by: 0

README

LiveMD

All your stream meta information, in a single collaborative markdown file called a state file.

LiveMD is a live stream utility that enables a streamer to store meta information about their stream in a state file. Create a new state file for every stream, use the state file to track titles, notes, description, key words, tags, URLs, for every live stream.

Current supported integrations:

  • Twitch
  • YouTube
  • Mastodon
  • HackMD
  • Twitter
  • Discord

Workflow

Use livemd as your main source of livestreaming state.

Acquire Twitch ID

Go to the VODs page for your channel.

https://dashboard.twitch.tv/u/{{channel}}/content/video-producer

Find the most recent highlighter link, and pull the ID from the link.

https://dashboard.twitch.tv/u/{{channel}}/content/video-producer/highlighter/{{id}}

Now you can build the following URLs for your live stream.

# Video URL for the specific video
https://www.twitch.tv/videos/{{id}}

# Edit page for the specific video
https://dashboard.twitch.tv/u/krisnova/content/video-producer/edit/{{id}}
Create a new stream.

This will create a new local state file called live.md in the current directory.

This file will be the centralized state for the duration of your entire live stream.

live stream new <title>
live stream new "Hacking live on Kubernetes! Let's Go!"
Add fields to your stream.

The notify string is a 280 character string that is used to notify various services such as Twitter, Discord, etc

live stream update --notify "Had a rough night. Come watch me live. Exclusively on @Twitch. https://twitch.tv/krisnova"

The description string is used to populate the YouTube video description, as well as the archive webpage.

live stream update --notify "Had a rough night. Come watch me live. Exclusively on @Twitch. https://twitch.tv/krisnova" --description "You should never run this code, ever!"
Go Live Notifications

Documentation

Index

Constants

View Source
const (
	DefaultMode = 0644
)

Variables

View Source
var (
	Name        string
	Version     string
	Copyright   string
	License     string
	AuthorName  string
	AuthorEmail string
)

Functions

func Banner() string

func FileExists

func FileExists(path string) bool

func MoveFile

func MoveFile(src, dst string) error

MoveFile is primarily used for Archiving.

func ToNote

func ToNote(l *LiveMD, id string) (*hackmd.Note, error)

Types

type Link struct {
	URL      *url.URL
	Title    string
	Markdown string
}

type LiveMD

type LiveMD struct {

	// TwitchID is the twitch id for the VOD
	//
	// This MUST be set for every livemd as we couple this
	// software to Twitch.
	//
	//https://www.twitch.tv/videos/{{id}}
	//https://dashboard.twitch.tv/u/{{channel}}/content/video-producer/edit/{{id}}
	TwitchID      string
	TwitchChannel string

	Title       string
	Notify      string
	Description string

	// Subsystems
	Links   []*Link
	Twitter string
	// contains filtered or unexported fields
}

func Load

func Load(path string) (*LiveMD, error)

Load will attempt to load a *LiveMD from a path

func New

func New(path, twitchChannel, twitchID string) *LiveMD
func (l *LiveMD) AddLink(title, rawURL string) error

func (*LiveMD) CoalesceDateName

func (l *LiveMD) CoalesceDateName() string

CoalesceDateName will turn a title and today's date into a unix friendly name that can be used for file creation, and archiving.

h/t @mrxinu

func (*LiveMD) Read

func (l *LiveMD) Read() ([]byte, error)

Read will read from disk exactly, with no mutations.

func (*LiveMD) Render

func (l *LiveMD) Render() ([]byte, error)

Render will render the markdown and return the content. Render will (by design) always template!

func (*LiveMD) TwitchEditPage

func (l *LiveMD) TwitchEditPage() string

func (*LiveMD) TwitchVideoPage

func (l *LiveMD) TwitchVideoPage() string

func (*LiveMD) Write

func (l *LiveMD) Write() error

Write will first render the markdown, and write the result to the configured path

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL