2017-04-13 09:48:45 +02:00
|
|
|
# go-mastodon
|
|
|
|
|
2022-11-19 20:02:47 +01:00
|
|
|
Fork of https://github.com/mattn/go-mastodon
|
2021-11-04 15:05:34 +01:00
|
|
|
|
2017-04-13 09:48:45 +02:00
|
|
|
## Usage
|
|
|
|
|
2017-04-27 05:03:11 +02:00
|
|
|
### Client
|
|
|
|
|
|
|
|
```go
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
2017-04-26 18:46:18 +02:00
|
|
|
"log"
|
2017-04-27 05:03:11 +02:00
|
|
|
|
2022-11-20 16:49:10 +01:00
|
|
|
mastodon "git.gutmet.org/go-mastodon.git"
|
2017-04-26 18:46:18 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-11-20 21:31:59 +01:00
|
|
|
mastodon.Initialize(&mastodon.Config{
|
2017-04-26 18:46:18 +02:00
|
|
|
Server: "https://mstdn.jp",
|
|
|
|
ClientID: "client-id",
|
|
|
|
ClientSecret: "client-secret",
|
2022-11-20 21:31:59 +01:00
|
|
|
AccessToken: "accessToken",
|
2017-04-26 18:46:18 +02:00
|
|
|
})
|
2022-11-20 21:31:59 +01:00
|
|
|
timeline, err := GetTimelineHome(nil)
|
2017-04-26 18:46:18 +02:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
for i := len(timeline) - 1; i >= 0; i-- {
|
|
|
|
fmt.Println(timeline[i])
|
|
|
|
}
|
2017-04-13 09:48:45 +02:00
|
|
|
}
|
|
|
|
```
|
2017-04-27 05:03:11 +02:00
|
|
|
|
2017-04-14 17:37:27 +02:00
|
|
|
## Status of implementations
|
|
|
|
|
|
|
|
* [x] GET /api/v1/accounts/:id
|
|
|
|
* [x] GET /api/v1/accounts/verify_credentials
|
2017-04-16 14:01:46 +02:00
|
|
|
* [x] PATCH /api/v1/accounts/update_credentials
|
2017-04-14 17:37:27 +02:00
|
|
|
* [x] GET /api/v1/accounts/:id/followers
|
|
|
|
* [x] GET /api/v1/accounts/:id/following
|
2017-04-16 14:42:54 +02:00
|
|
|
* [x] GET /api/v1/accounts/:id/statuses
|
2017-04-14 17:37:27 +02:00
|
|
|
* [x] POST /api/v1/accounts/:id/follow
|
|
|
|
* [x] POST /api/v1/accounts/:id/unfollow
|
|
|
|
* [x] GET /api/v1/accounts/:id/block
|
|
|
|
* [x] GET /api/v1/accounts/:id/unblock
|
|
|
|
* [x] GET /api/v1/accounts/:id/mute
|
|
|
|
* [x] GET /api/v1/accounts/:id/unmute
|
2019-04-27 03:27:43 +02:00
|
|
|
* [x] GET /api/v1/accounts/:id/lists
|
2017-04-14 17:37:27 +02:00
|
|
|
* [x] GET /api/v1/accounts/relationships
|
|
|
|
* [x] GET /api/v1/accounts/search
|
2022-08-27 05:39:44 +02:00
|
|
|
* [x] GET /api/v1/apps/verify_credentials
|
2021-06-30 22:04:28 +02:00
|
|
|
* [x] GET /api/v1/bookmarks
|
2017-04-14 17:37:27 +02:00
|
|
|
* [x] POST /api/v1/apps
|
2017-04-15 09:28:18 +02:00
|
|
|
* [x] GET /api/v1/blocks
|
2020-02-24 23:05:13 +01:00
|
|
|
* [x] GET /api/v1/conversations
|
|
|
|
* [x] DELETE /api/v1/conversations/:id
|
|
|
|
* [x] POST /api/v1/conversations/:id/read
|
2017-04-15 09:28:18 +02:00
|
|
|
* [x] GET /api/v1/favourites
|
2022-03-12 11:59:12 +01:00
|
|
|
* [x] GET /api/v1/filters
|
|
|
|
* [x] POST /api/v1/filters
|
|
|
|
* [x] GET /api/v1/filters/:id
|
|
|
|
* [x] PUT /api/v1/filters/:id
|
|
|
|
* [x] DELETE /api/v1/filters/:id
|
2017-04-15 09:28:18 +02:00
|
|
|
* [x] GET /api/v1/follow_requests
|
2017-04-16 18:37:29 +02:00
|
|
|
* [x] POST /api/v1/follow_requests/:id/authorize
|
|
|
|
* [x] POST /api/v1/follow_requests/:id/reject
|
2017-04-14 17:37:27 +02:00
|
|
|
* [x] POST /api/v1/follows
|
|
|
|
* [x] GET /api/v1/instance
|
2018-01-29 04:29:39 +01:00
|
|
|
* [x] GET /api/v1/instance/activity
|
|
|
|
* [x] GET /api/v1/instance/peers
|
2019-04-27 03:27:43 +02:00
|
|
|
* [x] GET /api/v1/lists
|
|
|
|
* [x] GET /api/v1/lists/:id/accounts
|
|
|
|
* [x] GET /api/v1/lists/:id
|
|
|
|
* [x] POST /api/v1/lists
|
|
|
|
* [x] PUT /api/v1/lists/:id
|
|
|
|
* [x] DELETE /api/v1/lists/:id
|
|
|
|
* [x] POST /api/v1/lists/:id/accounts
|
|
|
|
* [x] DELETE /api/v1/lists/:id/accounts
|
2017-04-17 06:56:35 +02:00
|
|
|
* [x] POST /api/v1/media
|
2017-04-17 06:00:53 +02:00
|
|
|
* [x] GET /api/v1/mutes
|
2017-04-14 17:37:27 +02:00
|
|
|
* [x] GET /api/v1/notifications
|
|
|
|
* [x] GET /api/v1/notifications/:id
|
2021-05-03 03:16:04 +02:00
|
|
|
* [x] POST /api/v1/notifications/:id/dismiss
|
2017-04-14 17:37:27 +02:00
|
|
|
* [x] POST /api/v1/notifications/clear
|
2019-05-17 23:47:32 +02:00
|
|
|
* [x] POST /api/v1/push/subscription
|
|
|
|
* [x] GET /api/v1/push/subscription
|
|
|
|
* [x] PUT /api/v1/push/subscription
|
|
|
|
* [x] DELETE /api/v1/push/subscription
|
2017-04-16 21:51:16 +02:00
|
|
|
* [x] GET /api/v1/reports
|
|
|
|
* [x] POST /api/v1/reports
|
2020-03-01 12:18:26 +01:00
|
|
|
* [x] GET /api/v2/search
|
2017-04-14 17:37:27 +02:00
|
|
|
* [x] GET /api/v1/statuses/:id
|
|
|
|
* [x] GET /api/v1/statuses/:id/context
|
|
|
|
* [x] GET /api/v1/statuses/:id/card
|
2017-04-16 14:01:46 +02:00
|
|
|
* [x] GET /api/v1/statuses/:id/reblogged_by
|
|
|
|
* [x] GET /api/v1/statuses/:id/favourited_by
|
|
|
|
* [x] POST /api/v1/statuses
|
2017-04-15 14:07:11 +02:00
|
|
|
* [x] DELETE /api/v1/statuses/:id
|
2017-04-16 14:01:46 +02:00
|
|
|
* [x] POST /api/v1/statuses/:id/reblog
|
|
|
|
* [x] POST /api/v1/statuses/:id/unreblog
|
|
|
|
* [x] POST /api/v1/statuses/:id/favourite
|
|
|
|
* [x] POST /api/v1/statuses/:id/unfavourite
|
2021-06-30 22:04:28 +02:00
|
|
|
* [x] POST /api/v1/statuses/:id/bookmark
|
|
|
|
* [x] POST /api/v1/statuses/:id/unbookmark
|
2017-04-14 17:37:27 +02:00
|
|
|
* [x] GET /api/v1/timelines/home
|
2017-04-15 09:28:18 +02:00
|
|
|
* [x] GET /api/v1/timelines/public
|
2017-04-15 14:02:55 +02:00
|
|
|
* [x] GET /api/v1/timelines/tag/:hashtag
|
2019-04-27 03:56:47 +02:00
|
|
|
* [x] GET /api/v1/timelines/list/:id
|
2021-02-25 15:25:44 +01:00
|
|
|
* [x] GET /api/v1/streaming/user
|
|
|
|
* [x] GET /api/v1/streaming/public
|
|
|
|
* [x] GET /api/v1/streaming/hashtag?tag=:hashtag
|
|
|
|
* [x] GET /api/v1/streaming/hashtag/local?tag=:hashtag
|
|
|
|
* [x] GET /api/v1/streaming/list?list=:list_id
|
2021-02-25 15:26:45 +01:00
|
|
|
* [x] GET /api/v1/streaming/direct
|
2017-04-13 09:48:45 +02:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
MIT
|
|
|
|
|
2022-11-19 20:04:03 +01:00
|
|
|
## Author of original (https://github.com/mattn/go-mastodon)
|
2017-04-13 09:48:45 +02:00
|
|
|
|
|
|
|
Yasuhiro Matsumoto (a.k.a. mattn)
|
2022-11-20 16:49:10 +01:00
|
|
|
|
|
|
|
## Screwed up by
|
|
|
|
|
|
|
|
Alexander Weinhold (a.k.a gutmet)
|