archive

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 10 Imported by: 0

README

archive-go

一个检测链接 -> 爬取数据 -> 备份到Telegraph的 Golang 库。

工作流程:给我一些字符串,我会检测其中的链接,然后启动爬虫程序,将链接中的信息抓下来然后上传到 Telegraph 平台上,然后将 Telegraph 的文章链接返回给你。

同时提供保存纯文本的接口,将传入的文本直接保存到 Telegraph 平台,然后返回一个可访问的链接。

接口

请移步go doc

开始

  1. 下载依赖
go get -u github.com/MakeGolangGreat/archive-go
  1. test.go
package main

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

func main(){
	link, err := archive.Save("<h1>html strings here</h1>", "...telegraph-token here...", "...attach info here...")
	if err != nil {
    fmt.Println("Save Article Failed: ", err)
  }else{
    fmt.Println(link)
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(updateText string, token string, attachInfo *telegraph.NodeElement, more *More) (msg string, err error)

Save 是一个备份函数,将链接内的文本抓取然后备份到Telegraph,然后返回一个Telegraph链接。

func Text

func Text(updateText string, token string) (msg string, err error)

Text 是一个备份函数,将传递过来的文本备份到Telegraph,不管里面有没有链接,全部当成文本备份 然后返回一个Telegraph链接

Types

type More added in v1.0.3

type More struct {
	IncludeAll bool `json:"includeall"`
}

Other 是项目的高级配置

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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