getmoe: github.com/leonidboykov/getmoe/provider/sankaku Index | Files

package sankaku

import "github.com/leonidboykov/getmoe/provider/sankaku"

Package sankaku implements a simple library for accessing Sankakucomplex-based image boards.

Index

Package Files

post.go provider.go

type Post Uses

type Post struct {
    Width        int         `json:"width"`
    SampleWidth  int         `json:"sample_width"`
    FileSize     int         `json:"file_size"`
    IsFavorited  bool        `json:"is_favorited"`
    Status       string      `json:"status"`
    Rating       string      `json:"rating"`
    SampleHeight int         `json:"sample_height"`
    Md5          string      `json:"md5"`
    HasComments  bool        `json:"has_comments"`
    ParentID     interface{} `json:"parent_id"`
    HasChildren  bool        `json:"has_children"`
    Change       int         `json:"change"`
    HasNotes     bool        `json:"has_notes"`
    Source       string      `json:"source"`
    // Author       string      `json:"author"`
    CreatedAt struct {
        N         int    `json:"n"`
        JSONClass string `json:"json_class"`
        S         int    `json:"s"`
    }   `json:"created_at"`
    FavCount     int `json:"fav_count"`
    Height       int `json:"height"`
    PreviewWidth int `json:"preview_width"`
    Tags         []struct {
        Type   int    `json:"type"`
        NameJa string `json:"name_ja"`
        Count  int    `json:"count"`
        Name   string `json:"name"`
        ID     int    `json:"id"`
    }   `json:"tags"`
    RecommendedPosts interface{} `json:"recommended_posts"`
    SampleURL        string      `json:"sample_url"`
    FileURL          string      `json:"file_url"`
    ID               int         `json:"id"`
    PreviewHeight    int         `json:"preview_height"`
    PreviewURL       string      `json:"preview_url"`
    VoteCount        int         `json:"vote_count"`
    TotalScore       int         `json:"total_score"`
}

Post contains native Sankaku data

type Provider Uses

type Provider struct {
    URL          *url.URL
    Headers      map[string]string
    PasswordSalt string
    AppkeySalt   string
    PostsLimit   int
}

Provider implements sankaku provider

func New Uses

func New(config getmoe.ProviderConfiguration) *Provider

New creates a new sankaku provider with configuration

func (*Provider) Auth Uses

func (p *Provider) Auth(config getmoe.AuthConfiguration)

Auth builds query based on AuthConfiguration

func (*Provider) BuildRequest Uses

func (p *Provider) BuildRequest(config getmoe.RequestConfiguration)

BuildRequest builds query based on RequestConfiguration

func (*Provider) New Uses

func (p *Provider) New(config getmoe.ProviderConfiguration)

New creates a new sankaku provider with configuration

func (*Provider) NextPage Uses

func (p *Provider) NextPage()

NextPage increments page by 1

func (*Provider) PageRequest Uses

func (p *Provider) PageRequest() (*http.Request, error)

PageRequest builds page request from URL

func (*Provider) Parse Uses

func (p *Provider) Parse(data []byte) ([]getmoe.Post, error)

Parse parses result from query

Package sankaku imports 10 packages (graph) and is imported by 1 packages. Updated 2019-03-11. Refresh now. Tools for package owners.