story

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

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

Go to latest
Published: Dec 28, 2021 License: MIT Imports: 20 Imported by: 0

README

Story

Tistory blog post manager

Prerequisites

Install

  1. With Go

     go get github.com/nullbus/story/story
    
  2. Without Go

    TODO

You must run story init to setup your tistory account. It configures your environment and retrives your first access token. If the access token expires, just run story auth to begin reauthentication.

Usage

Command
story <command> [options...]
  story init
  story auth
  story info
  story show
  story edit
  story post
Get your blog information
story info -blog <blog name>
Get single blog post
story show -blog <blog name> <post id>

Documentation

Index

Constants

View Source
const AUTH_REDIRECT_CONTENT = `` /* 764-byte string literal not displayed */

Variables

This section is empty.

Functions

func Info

func Info(accessToken string) (string, error)

Info gets information about blog.

Types

type EditConfig

type EditConfig struct {
	BlogName string
	Title    string
	File     string
	PostID   string
	DryRun   bool
}

func (*EditConfig) Do

func (config *EditConfig) Do(accessToken string) error

func (*EditConfig) Parse

func (c *EditConfig) Parse(args []string) error

type InitConfig

type InitConfig struct {
	RedirectPort int
	RedirectPath string
	ClientID     string
	ClientSecret string
	AccessToken  string
}

func (*InitConfig) Authorize

func (config *InitConfig) Authorize() error

func (*InitConfig) Load

func (c *InitConfig) Load() error

func (*InitConfig) Parse

func (c *InitConfig) Parse(args []string) error

func (*InitConfig) Save

func (c *InitConfig) Save() error

type PostConfig

type PostConfig struct {
	BlogName string
	Title    string
	File     string
	DryRun   bool
}

func (*PostConfig) Do

func (config *PostConfig) Do(accessToken string) error

func (*PostConfig) Parse

func (c *PostConfig) Parse(args []string) error

type TistoryPost

type TistoryPost struct {
	ID              string `json:"id"`
	Title           string `json:"title"`
	Content         string `json:"content"`
	CategoryID      int    `json:"categoryId,string"`
	PostURL         string `json:"postUrl"`
	Visibility      int    `json:"visibility,string"`
	AcceptComment   int    `json:"acceptCommnet,string"`
	AcceptTrackback int    `json:"acceptTrackback,string"`
	Comments        int    `json:"comments,string"`
	Trackbacks      int    `json:"trackbacks,string"`
	Date            string `json:"date"`
}
"item":{
	"id":"1",
	"title":"티스토리 OAuth2.0 API 오픈!",
	"content":"안녕하세요 Tistory API 입니다.<br><br>이번에 Third-party Developer 용 <b>Tistory OAuth 2.0 API</b> 가 오픈됩니다.<br>Tistory 회원이라면, 여러분의 모든 app에 자유롭게 활용하실 수 있습니다.<br><br><div class="\"imageblock" center\"="" style="\"text-align:" center;="" clear:="" both;\"=""><img src="\"http://cfile10.uf.tistory.com/image/156987414DAF9799227B34\""></div><br><p></p>많은 기대와 사랑 부탁드립니다. <br> ",
	"categoryId":"0",
	"postUrl":"http://oauth.tistory.com/1",
	"visibility":"0",
	"acceptComment":"1",
	"acceptTrackback":"1",
	"tags : {
		tag : ["open", "api"]
	},
	"comments":"0",
	"trackbacks":"0",
	"date":"1303352668"
}

type TistoryRenderer

type TistoryRenderer struct {
	blackfriday.Renderer
	BlogName    string
	AccessToken string
	WorkingDir  string
}

TistoryRenderer takes image link and upload image if possible. Overrides blackfriday.Renderer.Image()

func (*TistoryRenderer) Image

func (t *TistoryRenderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte)

type ViewConfig

type ViewConfig struct {
	BlogName string
	PostID   string
}

func (*ViewConfig) Do

func (config *ViewConfig) Do(accessToken string) (*TistoryPost, error)

func (*ViewConfig) Parse

func (c *ViewConfig) Parse(args []string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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