An open API service indexing awesome lists of open source software.

https://github.com/archive-go/telegraph-go

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

go golang golang-examples golang-library golang-package telegram telegraph telegraph-api

Last synced: over 1 year ago
JSON representation

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

Awesome Lists containing this project

README

          

# telegraph-go

> 是一个封装了 [Telegraph API](https://telegra.ph/api) 的`Golang`库。
>
> 传入`HTML字符串`和`标题`数据(当然`telegraph-token`是必须的),telegraph-go会将它存储到Telegraph上,并返回一个可访问的链接给你。
>
> 如何获取`telegraph-token`?请看上面 [Telegraph API](https://telegra.ph/api) 文档

### APIs has achieved

---

- [x] `CreatePage`

### Getting Started

---

1. Download

```go
go get -u github.com/MakeGolangGreat/telegraph-go
```

2. `test.go`

```go
package main

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

func main(){
page := &telegraph.Page{
AccessToken: "............",
AuthorURL: "https://github.com/MakeGolangGreat/telegraph-go",
AuthorName: "telegraph-go",
Title: "Title here",
Data: "

Put html strings here.

",
}

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](https://github.com/MakeGolangGreat/archive-go) that using `telegraph-go` now.