twitterbots-go

twitter bots @soulstxt and @lacroix-bot
Log | Files | Refs | README | LICENSE

commit f38d7f1af4d03af8e6b1310f9254ff18b9a3a69c
parent f9207b1e96acb6d89230265818128ebf5878917e
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 27 Sep 2020 09:18:19 -0700

Final updates

Diffstat:
Mmain.go | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/main.go b/main.go @@ -18,7 +18,10 @@ func main() { flag.Parse() fmt.Println("Loading authentication data from", *fileName) config, err := loadConfig(fileName) - _, err = getTwitterClient(config) + if err != nil { + panic(err) + } + client, err := getTwitterClient(config) var tweet string if *mode == "souls" { tweet = generateSoulsTweet() @@ -31,9 +34,11 @@ func main() { if err != nil { panic(err) } - // _, _, err = client.Statuses.Update(tweet, nil) - // fetch username etc - fmt.Printf("Posted update \"%s\"\n", tweet) + postedTweet, _, err := client.Statuses.Update(tweet, nil) + if err != nil { + panic(err) + } + fmt.Printf("@%s posted update \"%s\"\n", postedTweet.User.ScreenName, tweet) if err != nil { panic(err) }