dousetsu

package module
v0.0.0-...-213e1de Latest Latest
Warning

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

Go to latest
Published: May 3, 2025 License: BSD-3-Clause Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Dousetsu Twitch Viewer Count Monitor

This project is a Twitch viewer count monitor built using the Fyne GUI toolkit. It displays the current viewer count, user information, and a graph of viewer count history.

Features

  • Display current viewer count
  • Show user information including display name, profile image, followers count, stream title, and game name
  • Indicate viewer count changes with arrows
  • Display the last update time
  • Plot a graph of viewer count history

Requirements

  • Go 1.12 or later
  • Fyne v2.0 or later

Installation

  1. Clone the repository:

    git clone https://github.com/lon9/dousetsu.git
    cd dousetsu
    
  2. Install dependencies:

    go mod tidy
    

Usage

  1. Build the application:

    go build -o monitor ./monitor/main.go
    
  2. Run the application with your Twitch login ID:

    ./monitor <Twitch login ID>
    

Example

To run the application for the Twitch user xqc, use the following command:

./monitor xqc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TwitchPubSubMessage

type TwitchPubSubMessage struct {
	Type string `json:"type"`
	Data struct {
		Topic   string `json:"topic"`
		Message string `json:"message"`
	} `json:"data"`
}

type TwitchViewCountMessage

type TwitchViewCountMessage struct {
	Type    string `json:"type"`
	Viewers int    `json:"viewers"`
}

type UserResponse

type UserResponse struct {
	User struct {
		ID              string `json:"id"`
		Login           string `json:"login"`
		DisplayName     string `json:"displayName"`
		ProfileImageURL string `json:"profileImageURL"`
		Followers       struct {
			TotalCount int `json:"totalCount"`
		} `json:"followers"`
		Stream struct {
			ID           string `json:"id"`
			Title        string `json:"title"`
			Type         string `json:"type"`
			ViewersCount int    `json:"viewersCount"`
			CreatedAt    string `json:"createdAt"`
			Game         struct {
				Name string `json:"name"`
			} `json:"game"`
		} `json:"stream"`
	} `json:"user"`
}

func Dousetsu

func Dousetsu(ctx context.Context, loginID string) (*UserResponse, chan int, error)

func GetUser

func GetUser(ctx context.Context, loginID string) (*UserResponse, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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