bookmarkable

package module
v0.0.0-...-c62da7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2016 License: MIT Imports: 8 Imported by: 0

README

Bookmarkable

Bookmarkable is a little program I've built to help me manage my bookmarks across multiple machines, from the command line. Yes, I could have (and have) used some third party thing, but in the end I just want simplicity and to be in control of my own data.

I'm using a secret Gist as storage, so you will neeed to setup a Personal Access Token on Github.

Install

Install the command line program.

go get -u github.com/scottjbarr/bookmarkable/cmd/bookmarkable

Setup

Create a Personal Access Token on Github.

Create a Personal Access Token on Github. The only permission required is Create Gist. Take note of this token after creation as you cannot view it again. (Worst case, you can regenerate the token.)

Create an empty Gist

Create a secret gist named bookmarkable.json, with content []

This is on my TODO list :)

Create a configuration file

Create a config file at ~/.bookmarkable/config.json.

If your token was foo, the config file will need to contain...

{
  "token": "foo"
}

Run

Sync your bookmarks.

bookmarkable sync

Add a bookmark. Tags are optional.

bookmarkable add http://example.com tag0 tag1 tag2

List bookmarks.

bookmarkable list

Search bookmarks for foo.

bookmarkable search foo

TODO?

  • Handle commands and flags
  • Create the initial gist
  • Command based docs from command line
  • Prevent clobbering later version of gist
  • Make URL's unique
  • Delete bookmark(s)
  • Public bookmarks
  • Publish a HTML friendly list of bookmarks?
  • Alternative storage?

Licence

The MIT License (MIT)

Copyright (c) 2016 Scott Barr

See LICENCE.md

Documentation

Overview

Package bookmarkable manages private bookmarks using Gist as the storage mechanism.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bookmark

type Bookmark struct {
	Title     string    `json:"title"`
	URL       string    `json:"url"`
	Tags      []string  `json:"tags"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Bookmark represents a single Bookmark

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB is the front end storage model.

func New

func New(configFileName *string, dbDir string) (*DB, error)

New creates and returns a DB from a config file.

func (*DB) Add

func (db *DB) Add(url string, tags []string) error

Add adds a new Bookmark to the collection, and updates storage.

func (*DB) GetBookmarks

func (db *DB) GetBookmarks() ([]*Bookmark, error)

GetBookmarks returns all locally stored Bookmark structs.

func (*DB) Search

func (db *DB) Search(phrase string) []*Bookmark

Search returns Bookmarks structs that match the given phrase.

func (*DB) Sync

func (db *DB) Sync() error

Sync updates local bookmarks with the remote copy.

This does not merge bookmarks so anything you have managed to store locally will be overwritten.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL