Created
November 7, 2022 10:51
-
-
Save uraimo/174ffaa816d894b5ab9fda89d085139b to your computer and use it in GitHub Desktop.
Revisions
-
uraimo created this gist
Nov 7, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ package main import ( "os" "strings" "context" "log" "github.com/mattn/go-mastodon" //Thanks Mattn! ) func main() { args := os.Args[1:] toot := strings.Join(args," ") c := mastodon.NewClient(&mastodon.Config{ Server: "https://mastodon.social", ClientID: "133t133t133t133t133t133t133t133t133t133t133t", ClientSecret: "133t133t133t133t133t133t133t133t-133t133t", }) err := c.Authenticate(context.Background(), "youremail", "yourpwd") if err != nil { log.Fatal(err) } _, err = c.PostStatus(context.Background(), &mastodon.Toot{ Status: toot, }) if err != nil { log.Fatal(err) } }