Skip to content

A script collection for fetching, summarizing, and saving Pocket articles in markdown format locally. Ideal for use with Obsidian.

Notifications You must be signed in to change notification settings

ainoya/PocketMD

Repository files navigation

Pocket Article Fetcher

Overview

  • This is a collection of scripts designed to retrieve articles saved in Pocket and save them locally in markdown format.
  • It stores information in a local SQLite database and includes features to fetch additional information not available from Pocket API.

Features

  • Retrieve articles from Pocket and save them in SQLite.
  • Extract URLs from SQLite and use the Distiller API to fetch the full text of the articles and save it.
  • Generate summaries of articles using Google Vertex AI based on the information stored in SQLite.
  • Convert the information stored in SQLite to markdown format and save it locally, intended for use with Obsidian or similar applications.

Required Environment Variables

You will need authentication credentials to connect to Pocket, an API key for the Distiller API, and GCP credentials to connect to Vertex AI.

Refer to the .env.example file for details.

Setup

npm install
# Initialize the database
npm run db:migrate

Usage

Fetch articles from Pocket:

npm run fetch

Retrieve the full text of articles:

npm run distill

Generate summaries of articles:

npm run summary

Execute all steps:

npm run fetch-write

Custom Instructions

When generating summaries, you can provide additional instructions to the AI by setting the CUSTOM_INSTRUCTION variable.

export CUSTOM_INSTRUCTIONS="Find up to three important keywords and add them separately at the end of the results, enclosing each keyword in double square brackets `[[ ]]`. Keyword output example: [[keyword1]] [[keyword2]] [[keyword3]]"

npm run summary

About

A script collection for fetching, summarizing, and saving Pocket articles in markdown format locally. Ideal for use with Obsidian.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published