twitchchatscraper

package module
v0.0.0-...-82fd534 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2016 License: MIT Imports: 11 Imported by: 2 modules, 1 package

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

twitch-chat-scraper

Build Status Coverage Status

##FAQ

Documentation

Index

Constants

View Source
const (
	TWITCH_API_CHAT_PROPERTIES_ENDPOINT = "https://api.twitch.tv/api/channels/%s/chat_properties"
	TWITCH_API_TOP_STREAM_ENDPOINT      = "https://api.twitch.tv/kraken/streams?limit=%d&offset=%d&broadcaster_language=en" // TODO: Make language configurable
)
View Source
const (
	IRC_PASS_STRING              = "PASS %s"
	IRC_USER_STRING              = "NICK %s"
	IRC_JOIN_STRING              = "JOIN #%s"
	IRC_PART_STRING              = "PART #%s"
	TWITCH_CHAT_SERVER_ADDRESS   = "irc.twitch.tv:6667"
	TIME_TO_WAIT_FOR_CONNECTION  = time.Second * 5
	TIME_BETWEEN_CHANNEL_SCRAPES = time.Minute * 20
	CHANNELS_TO_GET_PER_SCRAPE   = 1000
)

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(givenConfig *Config)

Types

type Config

type Config struct {
	TwitchUsername   string `json:"twitch_username"`
	TwitchOAuthToken string `json:"twitch_oauth_token"`
}
var Configuration *Config

type ElasticBroker

type ElasticBroker struct {
	// contains filtered or unexported fields
}

func (*ElasticBroker) Connect

func (e *ElasticBroker) Connect(givenUrl string) chan<- *irc.Message

type Locator

type Locator struct {
}

Locate the best chat server to connect to for a given twitch channel

func NewLocator

func NewLocator() *Locator

Locator constructor

func (*Locator) GetIrcServerAddress

func (l *Locator) GetIrcServerAddress(givenChannelName string) []string

func (*Locator) GetTopNChannels

func (l *Locator) GetTopNChannels(givenLimit int) []string

type Scraper

type Scraper struct {
	SubscribedTo map[string]bool
	// contains filtered or unexported fields
}

func NewScraper

func NewScraper() *Scraper

func (*Scraper) Connect

func (s *Scraper) Connect() (chan<- *string, <-chan *irc.Message)

func (*Scraper) Read

func (s *Scraper) Read(givenChan chan<- *irc.Message)

func (*Scraper) StartMessages

func (s *Scraper) StartMessages()

func (*Scraper) Write

func (s *Scraper) Write(givenChan <-chan *string)

type TwitchMessage

type TwitchMessage struct {
	Channel   string
	Message   string
	From      string
	Timestamp time.Time `json:"@timestamp"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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