Go to file
Arun Prakash Jana 39a796dc86 Update README.md
2015-11-10 13:03:11 +05:30
LICENSE Initial commit 2015-11-02 01:23:18 +05:30
Makefile Add Makefile and manpage. 2015-11-09 01:01:07 +05:30
markit First release version info, more color, image. 2015-11-10 12:25:54 +05:30
markit.1 First release version info, more color, image. 2015-11-10 12:25:54 +05:30
markit.png Updated. 2015-11-10 12:58:21 +05:30
README.md Update README.md 2015-11-10 13:03:11 +05:30

MarkIt

Screenshot

markit is a cmdline bookmark management utility written using Python3 and SQLite3. markit exists because of my monumental dependency on historious. I wanted the same database on my local system. However, I couldn't find any equally flexible solution. Hence, MarkIt!

The SQLite3 database file is stored in $HOME/.cache/markit/bookmarks.db for each user.

markit is GPLv3 licensed.

If you find markit useful, please consider donating via PayPal.
Donate Button with Credit Cards

Features

  • Add, update or remove a bookmark
  • Add tags to bookmarks
  • Optionally fetch page title data from the web (default: disabled, use -o)
  • Use (partial) tags or keywords to search bookmarks
  • Unique URLs to avoid duplicates, show index if URL already exists
  • Open search results in browser
  • Browser (Chromium and Firefox based) errors and warnings suppression
  • Show single bookmark by ID or all bookmarks in a go
  • Delete all bookmarks
  • Add a bookmark at Nth index, to fill deleted bookmark indexes
  • Secure SQLite3 queries to access database
  • Handle first level of redirections (reports IP blocking)
  • Unicode in URL works
  • UTF-8 request and response, page character set detection
  • Works with Python 3.x
  • Coloured output for clarity
  • Manpage for quick reference
  • Optional debug information
  • Fast and clean (no ads or clutter)
  • Minimal dependencies
  • Open source and free

Installation

markit requires Python 3.x to work.

  1. If you have git installed (the steps are tested on Ubuntu 14.04.3 x64_64):
$ git clone https://github.com/jarun/markit/  
$ cd markit
$ sudo make install

To remove, run:

$ sudo make uninstall
  1. If you do not have git installed:
    Download the latest stable release or development version source code. Extract, cd into the directory and run:
$ sudo make install

If you do not want to install, markit is standalone:

$ chmod +x markit
$ ./markit ...

Usage

Operational notes:

  • It's advisable to copy URLs directly from the browser address bar, i.e., along with the leading http:// or https:// token. markit looks up title data (found within tags of HTML) from the web ONLY for fully-formed HTTP(S) URLs.
  • If the URL contains characters like ;, & or brackets they may be interpreted specially by the shell. To avoid it, add the URL within single ' or double " qoutes.
  • The same URL cannot be added twice. You can update tags and re-fetch title data. You can also delete it and insert at the same index.
  • You can either add or update or delete record(s) in one instance. A combination of these operations is not supported in a single run.
  • Search works in mysterious ways:
    • Substrings match (match matches rematched) for URL, tags and title data.
    • All the keywords are treated as a single tag together in the same order. Bookmarks with partial or complete tag matches are shown in results.
    • The same keywords are searched separately as unique tokens so that entries with matching URL or title data are also shown in the results. Order is irrelevant in this case.

Cmdline help:

Usage: markit [OPTIONS] KEYWORDS...
Bookmark manager. Your private Google.

Options
  -a URL tag 1, tag 2, ...   add URL as bookmark with comma separated tags
  -d N                       delete entry at index N
  -D                         delete ALL bookmarks
  -i N                       add entry at index N, works with -a, use to fill deleted index
  -o                         fetch title info from web, works with -a or -u
  -p N                       show details of bookmark record at index N
  -P                         show all bookmarks along with real index from database
  -s keyword(s)              search all bookmarks for a (partial) tag or each keyword
  -u N                       update entry at index N (from output of -p)
  -z                         show debug information
                             you can either add or update or delete in one instance
                             any other option shows help and exits markit

Keys
  1-N                        open Nth search result in browser. Enter exits markit.

Examples

  1. Add a new bookmark with tags linux news and open source:
$ markit -a http://tuxdiary.com linux news, open source
Added at index 15012014

The assigned automatic index 15012014 is unique, one greater than highest index already in use in database. 2. Add a bookmark, fetch page Title information from web:

$ markit -a -o http://tuxdiary.com linux news, open source
Title: [TuxDiary | Linux, open source and a pinch of leisure.]
Added at index 15012014
  1. Update existing bookmark at index 15012014 with a new tag:
$ markit -u 15012014 -o http://tuxdiary.com linux news, open source, magazine
Title: [TuxDiary | Linux, open source and a pinch of leisure.]
Updated
  1. Delete bookmark at index 15012014:
$ markit -d 15012014
  1. Delete all bookmarks:
$ markit -D
  1. Insert a bookmark at deleted index 15012014 (fails if index or URL exists in database):
$ markit -i 15012014 -a -o http://tuxdiary.com/about linux news, open source
Title: [A journey with WordPress | TuxDiary]
Added at index 15012014

This option is useful in filling deleted indices from database manually. 7. Show info on bookmark at index 15012014:

$ markit -p 15012014
  1. Show all bookmarks with real index from database:
$ markit -P
  1. Search bookmarks:
$ markit -s kernel debugging
  1. Show debug info:
$ markit -z
  1. Show help:
$ markit
  1. Show manpage:
$ man markit

#License GPL v3
Copyright (C) 2015 by Arun Prakash Jana <engineerarun@gmail.com>

Contributions

I would love to see pull requests with the following features:

  • Exact word match (against substring in a word as it works currently. Hint: REGEXP)
  • Parse full page data??? Might end up writing a search engine like Google. ;)
  • Optional password protection

Developer(s)

Arun Prakash Jana <engineerarun@gmail.com>