groupmestatsbot

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: BSD-2-Clause Imports: 5 Imported by: 0

README

GroupMe Stats Bot

Analyze statistics about a GroupMe group.

Installing

go get -u github.com/MagnusFrater/groupme-stats-bot

Features

Statistic Description
Top of the Pops who has the most overall favorites
Top of the Simps who favorited other messages the most
Top of the Narcissists who upvoted themselves the most
Top Poster who posts the most
Most Charismatic who posts top-tier messages (# of favorites received / # of messages they posted)
Top Lurker who lurks the most (# of favorites given out / # of messages they posted)
Top Rambler who has most messages that have zero favorites
Most Visionary who posts the most images
Top Messages the most favorited messages
Top Reposts the most duplicated messages
Text Frequency Analysis total message count, average message length, most used words, most used characters
Total Messages total messages count
Average Message Length average message length
Top Words the most used words
Top Characters the most used characters

Example

Coming soon!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	R         rune
	Frequency int
}

Character is a single text character.

type Member

type Member struct {
	ID   string
	Name string

	PopularityScore   int // how often did others favorite their messages
	UnpopularityScore int // how often did their messages get zero favorites
	SimpScore         int // how many times did they favorite someone else
	NarcissistScore   int // how many times did they favorite themselves
	VisionaryScore    int // how many images did they send

	NumMessages int // how many messages did they send
}

Member is a container for a GroupMe member's staistics.

func (*Member) Charisma

func (m *Member) Charisma() float64

Charisma returns the quality of their overall messages.

func (*Member) Lurkiness added in v0.6.0

func (m *Member) Lurkiness() float64

Lurkiness returns a ratio between their interactions with others' messages and how often they post messages themselves.

type Repost

type Repost struct {
	Messages        []*groupme.Message
	AuthorFrequency map[string]int // UserID -> frequency

	OriginalAuthor    string // UserID of the first author of the message
	OriginalCreatedAt int    // timestamp of the first message (integer seconds since the UNIX epoch)
}

Repost is a counter of message duplicates.

func (*Repost) TopReposters

func (r *Repost) TopReposters(limit int) []*RepostAuthor

TopReposters returns a sorted list of who reposted this message the most.

type RepostAuthor

type RepostAuthor struct {
	UserID    string
	Frequency int
}

RepostAuthor is a counter of authors of a repost.

type Stats

type Stats struct {
	Messages            []*groupme.Message  // GroupMe Messages to analyze
	Members             map[string]*Member  // UserID -> *Member
	WordFrequency       map[string]*Word    // text -> *Word
	CharacterFrequency  map[rune]*Character // rune -> *Character
	Reposts             map[string]*Repost  // text -> *Repost
	TotalMessagesLength int                 // the length of all messages combined together

	BlacklistedUserIDs map[string]struct{} // UserIDs to ignore while analyzing messages; UserID -> nil
}

Stats contains a GroupMe group's statistics.

func NewStats

func NewStats(messages []*groupme.Message) Stats

NewStats creates a new Stats.

func (*Stats) Analyze

func (s *Stats) Analyze()

Analyze analyzes a GroupMe group's messages.

func (*Stats) AverageMessageLength

func (s *Stats) AverageMessageLength() int

AverageMessageLength returns the average message length.

func (*Stats) Blacklist

func (s *Stats) Blacklist(userID string)

Blacklist blacklists a UserID such that it is ignored while analyzing messages.

func (*Stats) Blacklisted

func (s *Stats) Blacklisted(userID string) bool

Blacklisted returns whether the given UserID is blacklisted from being analyzed.

func (*Stats) MostCharismatic

func (s *Stats) MostCharismatic(limit int) []*Member

MostCharismatic returns a sorted list of who posts the highest quality messages. Charisma is defined as (# of favorites received / # of messages they posted).

func (*Stats) MostVisionary added in v0.6.0

func (s *Stats) MostVisionary(limit int) []*Member

MostVisionary returns a sorted list of who posted the most images.

func (*Stats) SprintAverageMessageLength

func (s *Stats) SprintAverageMessageLength() string

SprintAverageMessageLength formats an Average Message Length Bot post and returns the resulting string.

func (*Stats) SprintMostCharismatic

func (s *Stats) SprintMostCharismatic(limit int) string

SprintMostCharismatic formats a Most Charismatic Bot post and returns the resulting string.

func (*Stats) SprintMostVisionary added in v0.6.0

func (s *Stats) SprintMostVisionary(limit int) string

SprintMostVisionary formats a Most Visionary Bot post and returns the resulting string.

func (*Stats) SprintTextFrequencyAnalysis

func (s *Stats) SprintTextFrequencyAnalysis(limit int) string

SprintTextFrequencyAnalysis formats a Text Frequency Analysis Bot post and returns the resulting string.

func (*Stats) SprintTopCharacters

func (s *Stats) SprintTopCharacters(limit int) string

SprintTopCharacters formats a Top Characters Bot post and returns the resulting string.

func (*Stats) SprintTopLurker

func (s *Stats) SprintTopLurker(limit int) string

SprintTopLurker formats a Top Lurker Bot post and returns the resulting string.

func (*Stats) SprintTopMessages

func (s *Stats) SprintTopMessages(limit int) string

SprintTopMessages formats a Top Messages Bot post and returns the resulting string.

func (*Stats) SprintTopOfTheNarcissists

func (s *Stats) SprintTopOfTheNarcissists(limit int) string

SprintTopOfTheNarcissists formats a Top of the Narcissists Bot post and returns the resulting string.

func (*Stats) SprintTopOfThePops

func (s *Stats) SprintTopOfThePops(limit int) string

SprintTopOfThePops formats a Top of the Pops Bot post and returns the resulting string.

func (*Stats) SprintTopOfTheSimps

func (s *Stats) SprintTopOfTheSimps(limit int) string

SprintTopOfTheSimps formats a Top of the Simps Bot post and returns the resulting string.

func (*Stats) SprintTopPoster

func (s *Stats) SprintTopPoster(limit int) string

SprintTopPoster formats a Top Poster Bot post and returns the resulting string.

func (*Stats) SprintTopRambler

func (s *Stats) SprintTopRambler(limit int) string

SprintTopRambler formats a Top Rambler Bot post and returns the resulting string.

func (*Stats) SprintTopReposters

func (s *Stats) SprintTopReposters(limit int, text string) string

SprintTopReposters formats a Top Reposters Bot post and returns the resulting string.

func (*Stats) SprintTopReposts

func (s *Stats) SprintTopReposts(limit int) string

SprintTopReposts formats a Top Reposts Bot post and returns the resulting string.

func (*Stats) SprintTopWords

func (s *Stats) SprintTopWords(limit int) string

SprintTopWords formats a Top Words Bot post and returns the resulting string.

func (*Stats) SprintTotalMessages

func (s *Stats) SprintTotalMessages() string

SprintTotalMessages formats an Total Messages Bot post and returns the resulting string.

func (*Stats) TopCharacters

func (s *Stats) TopCharacters(limit int) []*Character

TopCharacters returns a sorted list of the most frequently used characters.

func (*Stats) TopLurker

func (s *Stats) TopLurker(limit int) []*Member

TopLurker returns a sorted list of who lurks the most. A lurker is defined as (# of favorites given out / # of messages they posted).

func (*Stats) TopMessages

func (s *Stats) TopMessages(limit int) []*groupme.Message

TopMessages returns a sorted list of the most favorited messages.

func (*Stats) TopOfTheNarcissists

func (s *Stats) TopOfTheNarcissists(limit int) []*Member

TopOfTheNarcissists returns a sorted list of the biggest narcissistic members. A narcissist is defined as someone who favorites their own messages the most.

func (*Stats) TopOfThePops

func (s *Stats) TopOfThePops(limit int) []*Member

TopOfThePops returns a sorted list of the most popular members. Popularity is defined as someone who has the most favorites.

func (*Stats) TopOfTheSimps

func (s *Stats) TopOfTheSimps(limit int) []*Member

TopOfTheSimps returns a sorted list of the biggest simp members. A simp is defined as someone who favorites other members' messages the most.

func (*Stats) TopPosters

func (s *Stats) TopPosters(limit int) []*Member

TopPosters returns a sorted list of who posted the most messages.

func (*Stats) TopRambler

func (s *Stats) TopRambler(limit int) []*Member

TopRambler returns a sorted list of who has the most messages with zero favorites.

func (*Stats) TopReposts

func (s *Stats) TopReposts(limit int) []*Repost

TopReposts returns a sorted list of the most duplicated messages.

func (*Stats) TopWords

func (s *Stats) TopWords(limit int) []*Word

TopWords returns a sorted list of the most frequently used words.

func (*Stats) TotalMessages

func (s *Stats) TotalMessages() int

TotalMessages returns the total number of messages.

type Word

type Word struct {
	Text      string
	Frequency int
}

Word is a single text token. These make up a GroupMe message's text.

Directories

Path Synopsis
cmd
bot

Jump to

Keyboard shortcuts

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