You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arnaucode dfbae1fd70 Add from pad link to IPFS works. Get from IPFS to file works. 6 years ago
.gitignore Add from pad link to IPFS works. Get from IPFS to file works. 6 years ago
LICENSE Add from pad link to IPFS works. Get from IPFS to file works. 6 years ago
README.md Add from pad link to IPFS works. Get from IPFS to file works. 6 years ago
pad2ipfs.go Add from pad link to IPFS works. Get from IPFS to file works. 6 years ago
pad2ipfs_test.go Add from pad link to IPFS works. Get from IPFS to file works. 6 years ago

README.md

pad2ipfs Go Report Card

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').

Install

go get github.com/arnaucode/pad2ipfs

Usage

The added pads are stored in 'addedPads' directory. The getted pads are stored in 'gettedPads' directory.

- Add

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:

  • md
  • txt
  • html
  • pdf
  • odt
- Get

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)
}