Skip to content

Save to Instapaper via ZSH script w/ Qutebrowser userscript support

License

Notifications You must be signed in to change notification settings

dmix/instapaper.zsh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Save to Instapaper via ZSH script w/ Qutebrowser userscript support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%