Be a bit more verbose regarding actions
Signed-off-by: Shin'ya Minazuki <shinyoukai@laidback.moe>
This commit is contained in:
@@ -41,5 +41,8 @@ func observe(cli *client.Client, nick, url string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Infof("Followed sucessfully: %s [%s]\n", nick, url)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
22
login.go
22
login.go
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
@@ -62,9 +63,20 @@ func signin(cli *client.Client) {
|
||||
|
||||
token := strings.Trim(fmt.Sprintf(res.Token), "{}")
|
||||
|
||||
fmt.Println("Login successful")
|
||||
fmt.Println("Place this token in your configuration file for later use")
|
||||
fmt.Println("Do not share it with anyone, it's classified information!")
|
||||
fmt.Println("")
|
||||
fmt.Printf("token = %v\n", token)
|
||||
config, err := os.UserConfigDir()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
configPath := config + "/mikuru.ini"
|
||||
|
||||
f, err := os.OpenFile(configPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
f.WriteString("token = " + token + "\n")
|
||||
|
||||
log.Info("Login successful")
|
||||
}
|
||||
|
||||
2
post.go
2
post.go
@@ -45,4 +45,6 @@ func write(cli *client.Client) {
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to publish tweet\n%s\n", err)
|
||||
}
|
||||
|
||||
log.Info("Tweet published")
|
||||
}
|
||||
|
||||
@@ -40,5 +40,8 @@ func leave_alone(cli *client.Client, nick string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Infof("Unfollowed sucessfully: %s\n", nick)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user