arnaucube
arnaucube/pad2ipfsPublic Self-hosted repository
pad2ipfs/README.md
README.mdRaw
 1# pad2ipfs [![Go Report Card](https://goreportcard.com/badge/github.com/arnaucode/pad2ipfs)](https://goreportcard.com/report/github.com/arnaucode/pad2ipfs)
 2
 3Simply Go lang library to get the content from a pad (etherpad) and put into IPFS.
 4
 5
 6Needs to have installed IPFS (https://ipfs.io), and the daemon running ('> ipfs daemon').
 7
 8## Install
 9```
10go get github.com/arnaucode/pad2ipfs
11```
12
13## Usage
14
15The added pads are stored in 'addedPads' directory.
16The getted pads are stored in 'gettedPads' directory.
17
18
19#### - Add
20Adds the content from a pad to IPFS
21
22```go
23hash, err := pad2ipfs.Add(link, format)
24```
25```go
26hash, err := pad2ipfs.Add("https://board.net/p/selectedpad", "md")
27if err!=nil{
28  fmt.Println(err)
29}
30```
31Supported formats:
32  - md
33  - txt
34  - html
35  - pdf
36  - odt
37
38
39
40#### - Get
41Gets the content from IPFS and stores it into a file
42
43```go
44err := pad2ipfs.Get(hash, filename)
45```
46```go
47err := pad2ipfs.Get("QmVyp4JSREK5syLmNRCafkZkhzC7CfvS9qYWKfvfffqK2B", "selectedpad.md")
48if err!=nil {
49  fmt.Println(err)
50}
51```
52
53
54
55### CLI
56In the directory /pad2ipfs-cli is placed the cli to interact directly with the library from the command line. Here is a screenshot:
57
58![pad2ipfs-cli-screenshot](https://raw.githubusercontent.com/arnaucode/pad2ipfs/master/pad2ipfs-cli-screenshot.png "pad2ipfs-cli-screenshot")