model

package
v0.0.0-...-ad4c16b Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Obama = TweetAuthor{
	Name:        "Barack Hussein Obama",
	ScreenNames: []string{"BarackObama", "POTUS44"},
	ModernDay:   false,
}

Obama is Barack Obama

View Source
var Trump = TweetAuthor{
	Name:        "Donald John Trump",
	ScreenNames: []string{"realDonaldTrump", "POTUS"},
	ModernDay:   true,
}

Trump is Donald Trump

Functions

This section is empty.

Types

type DBTweet

type DBTweet struct {
	IDStr      string
	ScreenName string
	CreatedAt  time.Time
	Body       string
}

DBTweet is a representation of a row in the tweets table in the local DB

func SeparateObamaTrump

func SeparateObamaTrump(tweet1 DBTweet, tweet2 DBTweet) (obamaTweet, trumpTweet DBTweet, err error)

SeparateObamaTrump takes two tweets and discerns which is Obama and which is Trump, if possible

type TweetAuthor

type TweetAuthor struct {
	Name        string
	ScreenNames []string
	ModernDay   bool
}

TweetAuthor represents a conceptual presidential tweet author This can correspond to multiple actual Twitter accounts

func GetAuthorByScreenName

func GetAuthorByScreenName(screenName string) (*TweetAuthor, error)

GetAuthorByScreenName picks out which author uses the given screen name

type TweetPair

type TweetPair struct {
	ID               int
	ShortID          string
	Tweet1IDStr      string
	Tweet1ScreenName string
	Tweet2IDStr      string
	Tweet2ScreenName string
}

TweetPair represents a unique pairing of two tweets

Jump to

Keyboard shortcuts

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