Code Monkey home page Code Monkey logo

bkmrkr's Introduction

bkmrkr

Private and personal bookmark manager

Features

  • Local, password-protected bookmark storage (in a sqlite3 database)
  • HTML for each bookmark is fetched and the metadata is cached locally (the filename is hashed)
  • Bookmarklet (Javascript) to save from a browser
  • Simple view of the latest 100 bookmarks with an "added" date & a "seen" flag/date
  • Multi-user (Note: there is no connection between users (and there never will be). See "What is missing?" below.)
  • URL-shortening: For bookmarks, you can access the bookmark by visiting .../n/<id> where <id> is the nanoid for that URL.
  • Data Matrix barcode for each bookmark (optional).

What is missing?

  • Social networking features: This tool is not meant to connect people. (See "Motivation" above for explanation.)
  • A full API. (Only an "add" method exists today. Others may be added later.)

Setup

  1. Create a user

    1. Rename users/users-template.js to users/users.js
    2. Run node generatePassword.js <_password_> and save the output in users/users.js as hashedPwd
  2. Create the database: sqlite bkmrks.db < bkmrks.sql (Note: change to the dbFile location as set in the configuration file. See below.)

  3. Configure the server

    • Required

      1. Rename template config file default-template.json to default.json
      2. Set the sessionKey with any unique string
      3. Set the port to an open port value (default: 8000)
      4. Set dbFile as the database name (default: ./data/bkmrks.sqlite)
      5. Set cookie.maxAgeDays (default: 7)
    • Optional

      1. Set cookie.domain to your domain. (Delete this entry if you don't want to set it. Default: none)
      2. Set useHttps to true (Default: false)
      3. Set contact with an email address (must be set in the header to add links to https://crates.io. Default: none)
      4. Set useTecITBarcodeGenerator to true to display Data Matrix barcode for each bookmark - useful for printing bookmarks or opening bookmarks from a phone. (Default: false)
  4. Add the node modules: npm i

  5. Start the server: node server.js

  6. Open your browser: http://localhost:8000/bkmrkr/

Use

Display all bookmarks

  • /bkmrkr/display
    • Required Parameters: None
    • Optional Parameters [If provided, they override any config settings.]
      • format: Either card (Bootstrap cards) or list (UL). (Default: card)
      • offset: Database row to start. (Default: 0)
      • showAll: Show all (i.e. seen (i.e. ToRead is a date value) and unseen (i.e. ToRead is no or null). Either yes or no. (Default: no)
      • barcode: Show Data Matrix barcode (provided by TEC-IT Barcode Generator). (Default: no)

Add a bookmark

  • /bkmrkr/add
    • Required Parameter:
      • url: The encoded URL (e.g. /bkmrkr/add?url=https%3A%2F%2Fmy.new.bookmark.com%2F%0A)
    • Optional Parameter:
      • title: The encoded page title (/bkmrkr/add?url=https%3A%2F%2Fmy.new.bookmark.com%2F&title=Some%20clever%20title). If not provided, the URL will be fetched and the title captured automatically

Notes

  • URLs (and Titles, when provided) must be URL encoded
  • ToRead is set to "yes" by default

Fetch a bookmark

  • Two options:
    • Nanoid: /n/<id>
    • Hash: /bkmrkr/visit/<hash>

Notes

  • ToRead is updated in the database to the current time when either fetch URL is called

Requirements

Notes

  • nanoid is configured with a slightly reduced alphabet - removing any potentially ambiguous letters/numbers - e.g. 0, 1, i, l, I.
const alphabet = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnopqrstuvwxyz';
const nanoid = customAlphabet(alphabet, 8);

See customer alphabet or size in the nanoid README for more info. According to the Nano ID CC, with this configuration "~159 years [are] needed, in order to have a 1% probability of at least one collision"

Motivation

I've been a pinboard.in user for 10 years. I have really enjoyed the service and appreciate that it was so cheap to join back then. Recently, the creator of that service asked me (and others who had paid a one-time fee) to switch to a subscription model. A completely reasonable request/model that will help him continue to develop and enhance the application.

If you want social networking and don't mind a "no-frills" service, pinboard.in is really great. It's cheap, easy to use, and rock solid. And he's promising more features. But it bills itself as "Social Bookmarking for Introverts" - and I don't need the "Social" part. In fact, I don't want my bookmarks in a service that is advertised and designed to be shared.

So I created this simple node app to save my bookmarks. It takes just a few minutes to set up and works great for me, without having to set all my bookmarks to "private" by default or ignoring how many other people have already bookmarked what I just added. If this is what you want, feel free to download and set up this app for yourself.

License

MIT. See the LICENSE file for the full license.

Final Notes

Initial starting point: https://github.com/passport/express-4.x-local-example

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.