Skip to content

一个封装了 Telegraph API 的 Golang 库。传入一些HTML字符串,telegraph-go会将它存储到Telegraph上,并返回一个可访问的链接给你

License

Notifications You must be signed in to change notification settings

archive-go/telegraph-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

telegraph-go

是一个封装了 Telegraph APIGolang库。

传入HTML字符串标题数据(当然telegraph-token是必须的),telegraph-go会将它存储到Telegraph上,并返回一个可访问的链接给你。

如何获取telegraph-token?请看上面 Telegraph API 文档

APIs has achieved


  • CreatePage

Getting Started


  1. Download
go get -u github.com/MakeGolangGreat/telegraph-go
  1. test.go
package main

imoprt "github.com/MakeGolangGreat/telegraph-go"

func main(){
  page := &telegraph.Page{
    AccessToken: "......<telegraph-token>......",
		AuthorURL:   "https://github.com/MakeGolangGreat/telegraph-go",
		AuthorName:  "telegraph-go",
    Title: 			 "Title here",
    Data:				 "<h1>Put html strings here.</h1>",
	}
  
  link, err := page.CreatePage()
	if err != nil {
    fmt.Println("Create Page Failed: ", err)
  }else{
    fmt.Println(link) 
  }
}

It's a very simple sample above. You maybe want to look this archive project that using telegraph-go now.

About

一个封装了 Telegraph API 的 Golang 库。传入一些HTML字符串,telegraph-go会将它存储到Telegraph上,并返回一个可访问的链接给你

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages