From: Adam Shamblin Date: Wed, 30 Nov 2022 04:53:34 +0000 (-0700) Subject: wip X-Git-Url: https://git.vexinglabs.com/?a=commitdiff_plain;h=ab2579c3e1436a4b6d9f15534e95130718d5e827;p=dead-tooter.git wip --- ab2579c3e1436a4b6d9f15534e95130718d5e827 diff --git a/README.md b/README.md new file mode 100644 index 0000000..04e835f --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# dead-tooter + +There are a lot of people who have moved to the Fediverse from Twitter, and for +some this is very exciting. + +The increase in volume has affected the administrators more than anyone, no +doubht, but the users have also been affected. While Mastodon's filters and feed +settings are exceedingly powerful, there are a few more things I'd like to be +able to do with my Fedi data. + +* Sort follows/followers + * by account age + * by age of last post + +* Delete follows/followers in bulk + * by account age + * by age of last post diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..e26e0b8 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module vexingworkshop.com/dead-tooter/v2 + +go 1.19 diff --git a/main.go b/main.go new file mode 100644 index 0000000..5b90022 --- /dev/null +++ b/main.go @@ -0,0 +1,61 @@ +package main + +import ( + "fmt" + "io" + "net/http" + "net/url" +) + +type App struct { + ClientName string `json:"client_name"` + RedirectUris string `json:"redirect_uris"` + Scopes string `json:"scopes"` + Website string `json:"website"` +} + +func (a App) Create() (application Application, err error) { + resp, err := http.PostForm("https://hackers.town/api/v1/apps", + url.Values{ + "client_name": {"dead-tooter"}, + "redirect_uris": {"urn:ietf:wg:oauth:2.0:oob"}, + "scopes": {"read:follows write:blocks"}, + "website": {"https://dead-tooter.vexingworkshop.com"}, + }, + ) + if err != nil { + return + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + fmt.Printf("%s", resp.Status) + fmt.Printf("%s", string(body)) + + return Application{}, nil +} + +type Application struct { + ID string `json:"id"` + Name string `json:"name"` + Website string `json:"website"` + RedirectURI string `json:"redirect_uri"` + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + VapidKey string `json:"vapid_key"` +} + +func (a Application) Login() {} + +func main() { + app := App{ + ClientName: "dead-tooter", + RedirectUris: "urn:ietf:wg:oauth:2.0:oob", + Scopes: "read:follows", + Website: "https://dead-tooter.vexingworkshop.com", + } + _, err := app.Create() + if err != nil { + panic(err.Error()) + } +}