Documentation ¶
Index ¶
- Constants
- Variables
- func CleanUnicode(in string) string
- func FindEpisodesLink(url string) (next string, err error)
- func GetVersionString() string
- func SwitchPage(url, page string) string
- type Episode
- func (this *Episode) AddLine(line *Line)
- func (this *Episode) Fetch() (err error)
- func (this *Episode) GetAbbrev() string
- func (this *Episode) Parse(scriptText io.Reader) (err error)
- func (this *Episode) Save(tx *pgx.Tx) (err error)
- func (this *Episode) ScriptString() string
- func (this *Episode) String() string
- type Line
- type Series
- type Speaker
- type VersionInfo
Constants ¶
View Source
const ( CREATE_EPISODE_TABLE = `` /* 269-byte string literal not displayed */ INSERT_EPISODE = `` /* 153-byte string literal not displayed */ )
View Source
const ( CREATE_LINE_TABLE = `` /* 233-byte string literal not displayed */ INSERT_LINE = ` insert into "line" ("episode_id", "speaker_id", "line") values ($1, $2, $3) returning ("id") ` )
View Source
const ( CREATE_SERIES_TABLE = ` create table "series" ( "id" serial primary key, "name" citext, "url" text, unique("name") ) ` INSERT_SERIES = ` insert into "series" ("name", "url") values ($1, $2) returning ("id") ` )
View Source
const ( CREATE_SPEAKER_TABLE = `` /* 188-byte string literal not displayed */ INSERT_SPEAKER = `` /* 186-byte string literal not displayed */ SELECT_SPEAKER = ` SELECT "id" FROM "speaker" WHERE "series_id" = $1 AND "name" = $2 ` )
View Source
const ( Version = "v0.0.4" VersionTag = "" )
Variables ¶
View Source
var AppInfo appInfo
Functions ¶
func CleanUnicode ¶
CleanUnicode replaces problematic characters from the Star Trek transcripts with suitable alternatives.
func FindEpisodesLink ¶
FindEpisodesLink searches a web page for a link to a list of episodes in a particular series and returns the URL for that page.
func GetVersionString ¶ added in v0.0.4
func GetVersionString() string
func SwitchPage ¶
SwitchPage replaces the final "index.htm" portion of a URL (if present) with a new page.
Types ¶
type Episode ¶
type Episode struct { ID int64 `json:"id"` Series *Series `json:"series"` Season int `json:"season"` Episode int `json:"episode"` Title string `json:"title"` Url string `json:"url"` Airdate *time.Time `json:"airdate"` Script []*Line `json:"script"` Log *zap.Logger }
func ParseEpisodeList ¶
ParseEpisodeList parses out each episode from a series of tables on a page that lists all episodes for a specific TV series.
func (*Episode) AddLine ¶
AddLine adds a new line from the episode's script, cleaning up any problematic characters in the process.
func (*Episode) ScriptString ¶
ScriptString combines all lines into a single string for the entire episode's script.
type Line ¶
type Line struct { ID int64 `json:"id"` Episode *Episode `json:"episode,omitempty"` Speaker string `json:"speaker"` Line string `json:"line"` // contains filtered or unexported fields }
type Speaker ¶
type Speaker struct { ID int64 `json:"id"` Series *Series `json:"series"` Name string `json:"name"` }
func NewSpeaker ¶
type VersionInfo ¶ added in v0.0.4
type VersionInfo struct { Version string `json:"version"` VersionTag string `json:"tag"` VersionString string `json:"version_string"` Revision string `json:"revision"` Branch string `json:"branch"` BuildUser string `json:"build_user"` BuildDate string `json:"build_date"` GoVersion string `json:"go_version"` }
Click to show internal directories.
Click to hide internal directories.