Giter Site home page Giter Site logo

homostellaris / tw5-get-pinboard-bookmarks Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 2.0 77 KB

Enrich your tiddlers with bookmarks from your Pinboard account.

License: MIT License

JavaScript 100.00%
tiddlywiki5 wiki plugin pinboard-api pinboard pinboard-bookmarks tiddler pinboard-account bookmark-tiddlers macros knowledge-management

tw5-get-pinboard-bookmarks's Introduction

TW5-get-pinboard-bookmarks

Enrich your tiddlers with bookmarks from your Pinboard account.

Bookmarks from your Pinboard account...

A screenshot of a pinboard bookmark.

...are included in tiddlers that share the same tags.

A screenshot of the list generated by the get-pinboard-bookmarks macro.

Important Things to Note

  • This plugin is a work in progress, it is not yet 1.0.
  • This plugin only works with the Node.js version of TiddlyWiki5.
  • There is a fork of the TiddlyWiki5 repo with a modified readme to walk you through setting up a TiddlyWiki server.
  • The Pinboard bookmarks are only retrieved on server startup as there are not currently any easy hooks to perform this action with TiddlyWiki's plugin system. However the fork linked above contains a script and instructions for setting up a cron job to restart the TiddlyWiki server, effectively providing regular updates to the bookmark tiddlers.

Getting Started

If you don't already have a clone of the TiddlyWiki5 repository.

git clone https://github.com/Jermolene/TiddlyWiki5.git

Clone this repo inside the plugins directory of the TiddlyWiki5 repository.

  1. cd TiddlyWiki5/plugins
  2. git clone https://github.com/moderatemisbehaviour/TW5-get-pinboard-bookmarks.git

Create an environment variable to hold your Pinboard API token.

  1. Go to the password section of your Pinboard's account setting page.
  2. Copy the full API token including the username.
  3. Create a pinboard_api_token envrionment variable.
If you're on Windows.

Type setx pinboard_api_token your_api_token into a command prompt. The environment variable will only be available in future instances of command prompt.

If you're on Linux.

Then there are a variety of ways you might create a persistent environment variable. StackOverflow has the answers.

If you don't already have a wiki created then create one.

  1. Navigate back to the root directory of the TiddlyWiki5 repository.
  2. node tiddlywiki your-wiki --init server

Add plugins to your wiki's tiddlywiki.info.

{
    ...,
    "plugins": [
        ...,
        "tiddlywiki/markdown",
        "TW5-get-pinboard-bookmarks"
    ],
    ...,
}

Open your wiki.

  1. From the root of the TiddlyWiki5 repository run: node tiddlywiki your-wiki --server
  2. Open your browser and go to http://localhost:8080.

Call the get-pinboard-bookmarks macro in tiddlers that you would like enriching with Pinboard bookmarks.

Add <<get-pinboard-bookmarks>> to the body of a tiddler that has tags which also appear on your Pinboard bookmarks.

How It Works

On startup the plugin retrieves all your bookmarks from the Pinboard API using the posts/all method. It asynchronously processes the JSON response and writes a new tiddler for each bookmark. These 'bookmark tiddlers' have the following characteristics:

  • They are saved in a .tid file with the naming convention pinboard_Bookmark_Title (the intention was that they be saved in tiddlers/pinboard but that is not possible until this pull request is merged on the TiddlyWiki5 repository).
  • They are tagged with $:/tags/Pinboard.
  • They have a url field that contains the URL of the original bookmark.
  • They have a type field set to text/x-markdown which means their content is parsed as Markdown.

Roadmap

  • Normalise Pinboard tags by replacing spaces with hyphens and capitalising words, allowing 'tag tiddlers' to have well formed titles.
  • Make Markdown parsing and tag normalisation optional via configuration.
  • Create Get Started instructions as well as readme and usage information in plugin section of Control Panel.
  • Add a system tiddler that summarises all bookmark tiddlers and provides buttons to delete all and resync.

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.