webhash

package module
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 8 Imported by: 1 module, 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

Webhash

网页摘要计算, 使用 HighwayHash 算法

安装

curl

sh -c "$(curl -fsSL https://github.com/xuender/webhash/raw/master/install.sh)"

wget

sh -c "$(wget -O- https://github.com/xuender/webhash/raw/master/install.sh)"

增加摘要网页

webhash add https://api.github.com/repos/golang/go/milestones/72

检查网页内容修改

webhash check
# 或者
webhash

更新网页摘要

webhash update

监视网页修改

webhash watch

定时执行

设置定时任务 crontab -e

# 每小时执行一次
0 * * * * ${HOME}/bin/webhash watch

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Highwayhash added in v1.1.0

func Highwayhash(bytes []byte) uint64

Highwayhash 摘要

Example
fmt.Printf("nil=%d\n", Highwayhash(nil))
fmt.Printf("test=%d\n", Highwayhash([]byte("test")))
Output:
nil=2319126219498428999
test=16819604689299744157

Types

type Hash

type Hash struct {
	ID    uint64
	URL   string
	Error error `yaml:"-"`
	Sum   uint64
	Time  int64
}

Hash 网页摘要

func Batch

func Batch(webURLs []string) []*Hash

Batch 批量摘要

func New

func New(webURL string) (h *Hash)

New 新建摘要

func Parse

func Parse(m interface{}) (*Hash, error)

Parse 解析

func (*Hash) Get

func (h *Hash) Get() (keep bool, err error)

Get 请求

func (*Hash) String

func (h *Hash) String() string

type Hashs

type Hashs []*Hash

Hashs 摘要列表

func NewHashs

func NewHashs(i interface{}) Hashs

NewHashs 新建列表

func (*Hashs) Add

func (h *Hashs) Add(hash *Hash)

Add 增加

Directories

Path Synopsis
cmd
webhash command

Jump to

Keyboard shortcuts

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