pill

package module
v0.0.0-...-ccf243d Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Pill 💊

GoDoc Go Report Card License

Pill (Pixiv illustration tool) is a parser utilized to grab illustration information from Pixiv.

Illustration information contains:

  • Illustration Title
  • Description
  • Tags
  • Creation Date & Time (represent in format of unix timestamp)
  • Picture URLs
  • Author Information
    • Pixiv Member ID
    • Name
    • Avatar URL

More details can be found in GoDoc.

Example

package main

import (
	"encoding/json"
	"fmt"
	"github.com/YKMeIz/Pill"
)

func main() {
	res, err := pill.Pixiv("66917712")

	if err != nil {
		panic(err)
	}

	b, err := json.Marshal(res)

	if err != nil {
		panic(err)
	}

	fmt.Println(string(b))
}

The output, in a pretty and human readable JSON format, would be:

{
  "title": "コード:002",
  "id": "66917712",
  "description": "Line drawings converted by exist images.線画は既存の画像で変換されます。",
  "tags": [
    "Code:002",
    "線画"
  ],
  "created_at": 1516617934,
  "sources": [
    "https://i.pximg.net/img-original/img/2018/01/22/19/45/34/66917712_p0.png",
    "https://i.pximg.net/img-original/img/2018/01/22/19/45/34/66917712_p1.png"
  ],
  "author": {
    "id": "16412800",
    "name": "90榣",
    "avatar": "https://i.pximg.net/user-profile/img/2018/01/22/19/30/01/13726842_b73c069f1a20efc265f12c2693fea41d_50.png"
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PixivInfo

type PixivInfo struct {
	// Title is illustration title.
	Title string `json:"title"`
	// ID is illustration ID. It comes from url query value of "illust_id".
	ID string `json:"id"`
	// Description is the description texts from illustration page.
	Description string `json:"description"`
	// Tags is the array of tags that illustration has.
	Tags []string `json:"tags"`
	// CreatedAt is unix timestamp of the illustration creation date time.
	CreatedAt int64 `json:"created_at"`
	// Sources is urls of pictures uploaded under the illustration.
	// It is an array because a illustration page may contain multiple pictures.
	Sources []string `json:"sources"`
	// Author is the author of the illustration.
	Author PixivMember `json:"author"`
}

PixivInfo describes the details of a Pixiv illustration work.

func Pixiv

func Pixiv(id string) (PixivInfo, error)

Pixiv returns the parsed details of a Pixiv illustration work.

type PixivMember

type PixivMember struct {
	// ID is the Pixiv member ID.
	ID string `json:"id"`
	// Name is the Pixiv member name.
	Name string `json:"name"`
	// Avatar is url of the Pixiv member avatar.
	Avatar string `json:"avatar"`
}

PixivMember describes the details of a Pixiv member (author).

Jump to

Keyboard shortcuts

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