47 lines
1.3 KiB
Go
Executable File
47 lines
1.3 KiB
Go
Executable File
package config
|
|
|
|
import (
|
|
"local/args"
|
|
"local/sandbox/contact/contact"
|
|
"os"
|
|
)
|
|
|
|
var (
|
|
Feed string
|
|
Root string
|
|
To string
|
|
Subject string
|
|
Emailer *contact.Emailer
|
|
)
|
|
|
|
func init() {
|
|
os.Setenv("LC_ALL", "C.UTF-8")
|
|
|
|
as := args.NewArgSet()
|
|
|
|
as.Append(args.STRING, "to", "message recipient", "squeaky2x3@gmail.com")
|
|
as.Append(args.STRING, "subject", "message subject", "youtuber error")
|
|
as.Append(args.STRING, "from", "message sender", "breellocaldev@gmail.com")
|
|
as.Append(args.STRING, "password", "message sender password", "ML3WQRFSqe9rQ8qNkm")
|
|
as.Append(args.STRING, "smtp", "smtp server:port", "smtp.gmail.com:465")
|
|
as.Append(args.STRING, "pop3", "pop3 server:port", "pop.gmail.com:995")
|
|
|
|
as.Append(args.STRING, "feed", "feed URL", "https://www.youtube.com/feeds/videos.xml?channel_id=UCwX0AEx-qIhQ9kgtlNhyIXw")
|
|
as.Append(args.STRING, "root", "root to save videos", "/tmp")
|
|
|
|
if err := as.Parse(); err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
Feed = as.Get("feed").GetString()
|
|
Root = as.Get("root").GetString()
|
|
To = as.Get("to").GetString()
|
|
Subject = as.Get("subject").GetString()
|
|
Emailer = &contact.Emailer{
|
|
From: as.Get("from").GetString(),
|
|
SMTP: as.Get("smtp").GetString(),
|
|
POP3: as.Get("pop3").GetString(),
|
|
Password: as.Get("password").GetString(),
|
|
}
|
|
}
|