- 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.
- 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.
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.
npm install
# Initialize the database
npm run db:migrate
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
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