Code Monkey home page Code Monkey logo

instapaper.zsh's Introduction

Instapaper.zsh (w/ Qutebrowser userscript support)

A simple ZSH script for adding URLs to Instapaper via CLI.

With support for functioning as a Qutebrowser userscript, create a keyboard short to save the current page to Instapaper.

See also: pinboard.zsh for a similar script for adding bookmarks to Pinboard.in via ZSH and Qutebrowser.

Installation

a) Install zsh and curl if not yet installed

b) Copy instapaper script to a local bin directory or run the installer

$ git clone https://github.com/t1mxg0d/instapaper.zsh
$ cd instapaper.zsh
$ chmod +x install
$ ./install

c) Export these two variables to your enviornment:

export INSTAPAPER_USER=<username>
export INSTAPAPER_PASS=<password>

Usage

To add a URL to instapaper just run:

$ instapaper add <url>

For example:

$ instapaper add https://github.com/t1mxg0d/instapaper.zsh/master/README.md
> Instapaper - Saving: https://github.com/t1mxg0d/instapaper.z....
> Instapaper - Article saved! {bookmark_id: 732753757}

Article is now accessible at: https://www.instapaper.com/read/732753757

Qutebrowser userscript

Symlink instapaper bin installed above to <QUTEBROWSER_DATA_FOLDER>/userscripts/. You can find out the location to your qutebrowser data folder by checking :version. If the userscripts folder doesn't exist, you must create it.

$ ln -sf <INSTALL_PATH>/instapaper <QUTEBROWSER_DATA_FOLDER>/instapaper

You can find out the <INSTALL_PATH> by executing which instapaper in the command line.

Alternative userscript setup

Creating global environment variables might be somewhat painful in some operating systems (e.g. OS X). Alternatively, you can use a wrapper script to export the environment variables to the instapaper script's execution context. This wrapper has been included to this repo: instaqute.

If you choose to use it, follow the instructions above replacing instapaper with instaqute (make sure you edit the instaqute script, add your credentials and the path to the instapaper script):

$ ln -sf <INSTALL_PATH>/instaqute <QUTEBROWSER_DATA_FOLDER>/instaqute

Testing

Test it out by running:

:spawn --userscript (instapaper/instaqute) {url}

Add a keyboard shortcut: bind sI spawn --userscript (instapaper/instaqute) {url}

Now open Qutebrowser and test out the keyboard shortcut. You can change sI so whatever keyboard shortcut you like.

  • Enjoy! t1mxg0d

Licence: GPL v3

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.