arnaucode e1993ed54c | 6 years ago | |
---|---|---|
pad2ipfs-cli | 6 years ago | |
.gitignore | 6 years ago | |
LICENSE | 6 years ago | |
README.md | 6 years ago | |
pad2ipfs-cli-screenshot.png | 6 years ago | |
pad2ipfs.go | 6 years ago | |
pad2ipfs_test.go | 6 years ago |
Simply Go lang library to get the content from a pad (etherpad) and put into IPFS.
Needs to have installed IPFS (https://ipfs.io), and the daemon running ('> ipfs daemon').
go get github.com/arnaucode/pad2ipfs
The added pads are stored in 'addedPads' directory. The getted pads are stored in 'gettedPads' directory.
Adds the content from a pad to IPFS
hash, err := pad2ipfs.Add(link, format)
hash, err := pad2ipfs.Add("https://board.net/p/selectedpad", "md")
if err!=nil{
fmt.Println(err)
}
Supported formats:
Gets the content from IPFS and stores it into a file
err := pad2ipfs.Get(hash, filename)
err := pad2ipfs.Get("QmVyp4JSREK5syLmNRCafkZkhzC7CfvS9qYWKfvfffqK2B", "selectedpad.md")
if err!=nil {
fmt.Println(err)
}
In the directory /pad2ipfs-cli is placed the cli to interact directly with the library from the command line. Here is a screenshot: