Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
/ scrapbox Public archive

This tool provides command line interface for scrapbox.io.

License

Notifications You must be signed in to change notification settings

ohtomi/scrapbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scrapbox

This tool provides command line interface for scrapbox.io.

Description

This is a tool to search pages by keywords, to print a content of a page, to print an encoded URL of a page, to print URLs linked by a page.

Usage

List page titles containing specified tags

$ scrapbox list -h
usage: scrapbox list [options...] PROJECT [TAGs...]

Options:
  --token, -t  Scrapbox connect.sid used to access private project.
  --host, -h   Scrapbox Host. By default, "https://scrapbox.io".
  --expire     Local Cache Expiration. By default, 3600 seconds.
  --ua         User Agent. By default, "ScrapboxGoClient/x.x.x"


$ scrapbox list go-scrapbox
title having paren ( ) mark
title having plus + mark
title having question ? mark
title having slash / mark
title having whitespaces
日本語タイトルのページ
地のリンクがあるページ
複数のリンクがあるページ
文章のなかにリンクがあるページ1
文章のなかにリンクがあるページ2

$ scrapbox list go-scrapbox english
title having paren ( ) mark
title having plus + mark
title having question ? mark
title having slash / mark
title having whitespaces

$ scrapbox list go-scrapbox english paren
title having paren ( ) mark

Print the content of the scrapbox page

$ scrapbox read -h
usage: scrapbox read [options...] PROJECT PAGE

Options:
  --token, -t  Scrapbox connect.sid used to access private project.
  --host, -h   Scrapbox Host. By default, "https://scrapbox.io".
  --expire     Local Cache Expiration. By default, 3600 seconds.
  --ua         User Agent. By default, "ScrapboxGoClient/x.x.x"


$ scrapbox read go-scrapbox "title having paren ( ) mark"
title having paren ( ) mark
#english #no-url #whitespace #no-slash #paren #no-plus #no-question

Print the URL of the scrapbox page

$ scrapbox open -h
usage: scrapbox open [options...] PROJECT PAGE

Options:
  --host, -h   Scrapbox Host. By default, "https://scrapbox.io".


$ scrapbox open go-scrapbox "title having paren ( ) mark"
https://scrapbox.io/go-scrapbox/title%20having%20paren%20(%20)%20mark

Print all URLs in the scrapbox page

$ scrapbox link -h
usage: scrapbox link [options...] PROJECT PAGE

Options:
  --token, -t  Scrapbox connect.sid used to access private project.
  --host, -h   Scrapbox Host. By default, "https://scrapbox.io".
  --expire     Local Cache Expiration. By default, 3600 seconds.
  --ua         User Agent. By default, "ScrapboxGoClient/x.x.x"


$ scrapbox link go-scrapbox "複数のリンクがあるページ"
https://www.google.co.jp
https://www.google.com

Environment Variables

  • SCRAPBOX_TOKEN: specify token instead of --token option.
  • SCRAPBOX_HOST: specify host instead of --host option.
  • SCRAPBOX_EXPIRATION: specify expire instead of --expire option.
  • SCRAPBOX_USER_AGENT: specify ua(user agent) instead of --ua option.
  • SCRAPBOX_HOME: specify scrapbox home directory. By default ~/.scrapbox/

Private Project

To access private project, use --token option:

$ scrapbox <sub command> --token s%3A... <arguments>

Scrapbox Enterprise

To access Scrapbox Enterprise, use --host option:

$ scrapbox <sub command> --host http://host:port <arguments>

Local Cache Control

To ignore local caches, set expire to zero:

$ scrapbox <sub command> --expire <expiration> <arguments>

Install

To install, use go get:

$ go get github.com/ohtomi/scrapbox/cmd/scrapbox

Or get binary from release page.

Contribution

  1. Fork (https://github.com/ohtomi/scrapbox/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create a new Pull Request

License

MIT

Author

Kenichi Ohtomi

About

This tool provides command line interface for scrapbox.io.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published