utils

package
v0.0.0-...-994a392 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2014 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTitle

func ExtractTitle(url string) (title string, err error)

func ExtractURL

func ExtractURL(str string) (url string, err error)

Extracts an URL out of a string

func FixInvalidUTF8

func FixInvalidUTF8(broken string) string

func GetPage

func GetPage(url string) (string, error)

func GetPageWithAuth

func GetPageWithAuth(url string, user string, pass string) (string, error)

func HateTrack

func HateTrack(nick, track string) (bool, error)

func IRCAction

func IRCAction(conn *irc.Connection, channel, action string)

func IRCAway

func IRCAway(conn *irc.Connection, message ...string)

func IRCInvite

func IRCInvite(conn *irc.Connection, nick, channel string)

func IRCOper

func IRCOper(conn *irc.Connection, user, pass string)

func IRCRedispatch

func IRCRedispatch(conn *irc.Connection, code, raw, nick, host, source, user string, arguments ...string)

func IRCTopic

func IRCTopic(conn *irc.Connection, channel string, topic ...string)

func LikeTrack

func LikeTrack(nick, track string) (bool, error)

func Request

func Request(nick, request string) (bool, error)

func Sleep

func Sleep(milliseconds int64)

func SliceToJavascriptArray

func SliceToJavascriptArray(js *otto.Otto, slice interface{}) otto.Value

Types

type ShoutcastServerStats

type ShoutcastServerStats struct {
	CurrentListeners int    `xml:"CURRENTLISTENERS"`
	PeakListeners    int    `xml:"PEAKLISTENERS"`
	MaxListeners     int    `xml:"MAXLISTENERS"`
	UniqueListeners  int    `xml:"UNIQUELISTENERS"`
	AverageTime      int    `xml:"AVERAGETIME"`
	ServerGenre      string `xml:"SERVERGENRE"`
	ServerUrl        string `xml:"SERVERURL"`
	ServerTitle      string `xml:"SERVERTITLE"`
	SongTitle        string `xml:"SONGTITLE"`
	StreamHits       int    `xml:"STREAMHITS"`
	StreamStatus     int    `xml:"STREAMSTATUS"`
	BackupStatus     int    `xml:"BACKUPSTATUS"`
	StreamPath       string `xml:"STREAMPATH"`
	StreamUptime     int    `xml:"STREAMUPTIME"`
	BitRate          int    `xml:"BITRATE"`
	Content          string `xml:"CONTENT"`
	Version          string `xml:"VERSION"`
}

func GetShoutcastStats

func GetShoutcastStats(cfg *config.Settings) (ShoutcastServerStats, error)

Does the full process for returning a populated shoutcast stat object

Jump to

Keyboard shortcuts

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