go-pixiv

module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2020 License: MIT

README

go-pixiv

go-pixiv is a Go client for AppAPI of Pixiv.

Features

  • AppAPI
    • Auth
    • User
      • Detail
      • Illusts
      • Novels
      • BookmarkedIllusts
      • BookmarkedNovels
      • Followings
      • Recommended
      • IllustBookmarkTags
      • NovelBookmarkTags
    • Illust
      • AddBookmark
      • DeleteBookmark
      • AddHistory
      • Comments
      • Detail
      • Related
      • NewFromFollowings
      • NewFromAll
      • NewFromMyPixiv
      • UgoiraMetadata
      • RecommendedIllusts
      • RecommendedManga
      • Ranking
    • Novel
      • AddBookmark
      • DeleteBookmark
      • AddHistory
      • Text
      • Comments
      • Detail
      • Recommended
      • Ranking
    • Comment
      • RepliesIllust
      • RepliesNovel
      • AddToIllust
      • AddToNovel
      • DeleteFromIllust
      • DeleteFromNovel
    • Search
      • IllustTrendingTags
      • NovelTrendingTags
      • Illusts
      • PopularIllustsPreview
      • Novels
      • PopularNovelsPreview
      • TagsStartWith
      • Users

Install

go get github.com/WOo0W/go-pixiv

Example

package main

import (
    "log"
    "github.com/WOo0W/go-pixiv/pixiv"
)

func main() {
    api := pixiv.New()

    api.SetUser("xxx@xxx.com", "password")
    // or api.SetRefreshToken("xxx")

    r, err := api.User.Detail(123, nil)
    if err != nil {
        log.Fatal(err)
    }
    log.Printf("%+v", r)

    api.Illust.AddBookmark(123, pixiv.RPublic, nil)
    api.Illust.AddBookmark(456, pixiv.RPrivate,
        &pixiv.AddBookmarkOptions{
        Tags: []string{"風景"},
    })

    r2, err := api.Search.Illusts("風景", &pixiv.SearchQuery{
        SearchTarget: pixiv.STExactMatchTags,
        Sort: pixiv.SDateDesc,
    })
    if err != nil {
      log.Fatal(err)
    }
    log.Printf("%+v", r2)
    log.Print(r2.NextIllusts())
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL