mastodon client for golang
 
 
Go to file
mattn 52ac299ec8 Merge branch 'master' into reports 2017-04-17 12:29:31 +09:00
cmd/mstdn breaking compatibility changes. take context for first arguments. 2017-04-17 11:10:29 +09:00
.gitignore add .gitignore 2017-04-14 23:47:04 +09:00
.travis.yml add .travis.yml 2017-04-14 17:14:55 +09:00
LICENSE add LICENSE 2017-04-14 19:22:24 +09:00
README.md Merge branch 'master' into reports 2017-04-17 12:29:31 +09:00
accounts.go breaking compatibility changes. take context for first arguments. 2017-04-17 11:10:29 +09:00
accounts_test.go breaking compatibility changes. take context for first arguments. 2017-04-17 11:10:29 +09:00
apps.go breaking compatibility changes. take context for first arguments. 2017-04-17 11:10:29 +09:00
apps_test.go breaking compatibility changes. take context for first arguments. 2017-04-17 11:10:29 +09:00
helper.go Add godoc to Base64EncodeFileName and Base64Encode 2017-04-16 02:24:46 +09:00
helper_test.go Add helper 2017-04-16 02:00:30 +09:00
instance.go breaking compatibility changes. take context for first arguments. 2017-04-17 11:10:29 +09:00
mastodon.go Use Request.WithContext 2017-04-17 12:25:20 +09:00
mastodon_test.go breaking compatibility changes. take context for first arguments. 2017-04-17 11:10:29 +09:00
notification.go Merge branch 'master' into fix-comment 2017-04-17 12:28:43 +09:00
report.go Add reports API 2017-04-17 04:53:30 +09:00
status.go breaking compatibility changes. take context for first arguments. 2017-04-17 11:10:29 +09:00
status_test.go breaking compatibility changes. take context for first arguments. 2017-04-17 11:10:29 +09:00
streaming.go add StreamingHome, StreamingHashtag 2017-04-15 21:03:02 +09:00
streaming_test.go separate test file 2017-04-16 20:05:42 +09:00

README.md

go-mastodon

Build Status Coverage Status GoDoc Go Report Card

Usage

c := mastodon.NewClient(&mastodon.Config{
	Server:       "https://mstdn.jp",
	ClientID:     "client-id",
	ClientSecret: "client-secret",
})
err := c.Authenticate("your-username", "your-password")
if err != nil {
	log.Fatal(err)
}
timeline, err := c.GetTimeline("/api/v1/timelines/home")
if err != nil {
	log.Fatal(err)
}

Status of implementations

  • GET /api/v1/accounts/:id
  • GET /api/v1/accounts/verify_credentials
  • PATCH /api/v1/accounts/update_credentials
  • GET /api/v1/accounts/:id/followers
  • GET /api/v1/accounts/:id/following
  • GET /api/v1/accounts/:id/statuses
  • POST /api/v1/accounts/:id/follow
  • POST /api/v1/accounts/:id/unfollow
  • GET /api/v1/accounts/:id/block
  • GET /api/v1/accounts/:id/unblock
  • GET /api/v1/accounts/:id/mute
  • GET /api/v1/accounts/:id/unmute
  • GET /api/v1/accounts/relationships
  • GET /api/v1/accounts/search
  • POST /api/v1/apps
  • GET /api/v1/blocks
  • GET /api/v1/favourites
  • GET /api/v1/follow_requests
  • POST /api/v1/follow_requests/:id/authorize
  • POST /api/v1/follow_requests/:id/reject
  • POST /api/v1/follows
  • GET /api/v1/instance
  • POST /api/v1/media
  • GET /api/v1/mutes
  • GET /api/v1/notifications
  • GET /api/v1/notifications/:id
  • POST /api/v1/notifications/clear
  • GET /api/v1/reports
  • POST /api/v1/reports
  • GET /api/v1/search
  • GET /api/v1/statuses/:id
  • GET /api/v1/statuses/:id/context
  • GET /api/v1/statuses/:id/card
  • GET /api/v1/statuses/:id/reblogged_by
  • GET /api/v1/statuses/:id/favourited_by
  • POST /api/v1/statuses
  • DELETE /api/v1/statuses/:id
  • POST /api/v1/statuses/:id/reblog
  • POST /api/v1/statuses/:id/unreblog
  • POST /api/v1/statuses/:id/favourite
  • POST /api/v1/statuses/:id/unfavourite
  • GET /api/v1/timelines/home
  • GET /api/v1/timelines/public
  • GET /api/v1/timelines/tag/:hashtag

Installation

$ go get github.com/mattn/go-mastodon

License

MIT

Author

Yasuhiro Matsumoto (a.k.a. mattn)