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.

58 lines
1.3 KiB

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