instapexport icon indicating copy to clipboard operation
instapexport copied to clipboard

Export your personal Instapaper data: bookmarked articles and highlights

#+begin_src python :dir src :results drawer :exports results import instapexport.export as E; return E.make_parser().prog #+end_src

#+RESULTS: :results:

Export your personal Instapaper data: bookmarked articles and highlights. :end:

  • Setting up
  1. The easiest way is =pip3 install --user git+https://github.com/karlicoss/instapexport=.

    Alternatively, use =git clone --recursive=, or =git pull && git submodules update --init=. After that, you can use =pip3 install --editable=.

  2. To use the API, you'd need to [[https://www.instapaper.com/main/request_oauth_consumer_token][request =oauth_id= and =oauth_secret=]] first

  3. Once you recieved them, use this to get =oauth_token= and =oauth_token_secret= (you only need to do it once): ~./export.py --login~

  • Exporting

#+begin_src python :dir src :results drawer :exports results import instapexport.export as E; return E.make_parser().epilog #+end_src

#+RESULTS: :results:

Usage:

Recommended: create =secrets.py= keeping your api parameters, e.g.:

: oauth_id = "OAUTH_ID" : oauth_secret = "OAUTH_SECRET" : oauth_token = "OAUTH_TOKEN" : oauth_token_secret = "OAUTH_TOKEN_SECRET"

After that, use:

: python3 -m instapexport.export --secrets /path/to/secrets.py

That way you type less and have control over where you keep your plaintext secrets.

Alternatively, you can pass parameters directly, e.g.

: python3 -m instapexport.export --oauth_id <oauth_id> --oauth_secret <oauth_secret> --oauth_token <oauth_token> --oauth_token_secret <oauth_token_secret>

However, this is verbose and prone to leaking your keys/tokens/passwords in shell history.

You can also import ~instapexport.export~ as a module and call ~get_json~ function directly to get raw JSON.

I highly recommend checking exported files at least once just to make sure they contain everything you expect from your export. If not, please feel free to ask or raise an issue!

:end:

  • Using the data

#+begin_src python :dir src :results drawer :exports results import instapexport.exporthelpers.dal_helper as D; return D.make_parser().epilog #+end_src

#+RESULTS: :results:

You can use =instapexport.dal= (stands for "Data Access/Abstraction Layer") to access your exported data, even offline. I elaborate on motivation behind it [[https://beepb00p.xyz/exports.html#dal][here]].

  • main usecase is to be imported as python module to allow for programmatic access to your data.

    You can find some inspiration in [[https://beepb00p.xyz/mypkg.html][=my.=]] package that I'm using as an API to all my personal data.

  • to test it against your export, simply run: ~python3 -m instapexport.dal --source /path/to/export~

  • you can also try it interactively: ~python3 -m instapexport.dal --source /path/to/export --interactive~

:end:

Example output:

: Parsed 203 pages : 10 most highlighed pages: : 41 https://www.wired.com/1995/06/xanadu/ "The Curse of Xanadu" : 14 https://jborichevskiy.com/posts/digital-tools/ "Digital Tools I Wish Existed" : 12 http://slatestarcodex.com/2017/08/07/contra-grant-on-exaggerated-differences/ "Contra Grant On Exaggerated Differences" : 12 https://slatestarcodex.com/2019/06/04/book-review-the-secret-of-our-success/ "Book Review: The Secret Of Our Success" : 10 https://intelligence.org/2013/12/13/aaronson/ "Scott Aaronson on Philosophical Progress - Machine Intelligence Research Institute" : 10 http://www.thebioneer.com/nervous-system-training-muscle-fiber-recruitment-rate-coding-explained/ "Nervous System Training - Muscle Fiber Recruitment and Rate Coding Explained - The Bioneer" : 9 https://srconstantin.wordpress.com/2016/06/06/nootropics/ "Nootropics" : 9 https://blog.dropbox.com/topics/work-culture/-the-mind-at-work--guido-van-rossum-on-how-python-makes-thinking "The Mind at Work: Guido van Rossum on how Python makes thinking in code easier" : 9 https://slatestarcodex.com/2019/12/11/acc-is-eating-meat-a-net-harm/ "[ACC] Is Eating Meat A Net Harm?" : 9 https://beepb00p.xyz/my-data.html "What data on myself I collect and why? | Mildly entertainingᵝ"