Research Pocket 🔖

The last save-it-later tool you'll ever need

GitHub Actions Workflow Status Crates.io version docs.rs docs Download

A self-hostable save-it-later tool that integrates with [getpocket.com](https://getpocket.com) (and others soon). works on the web and terminal > [!TIP] > Find the guide to creating your own static site on GitHub pages here > [ResearchPocket/my-list](https://github.com/ResearchPocket/my-list) 📚 ## How it works Hashnode logo ## Installation - Get the latest release binary for your desktop through the [releases page](https://github.com/KorigamiK/ResearchPocket/releases) - Using Cargo ```sh $ cargo install research ``` ## Generate your site This requires that you have [tailwindcss](https://tailwindcss.com/blog/standalone-cli) installed and available in your `$PATH` ```sh # Initialize the database $ research init # Authenticate with Pocket $ research pocket auth # Fetch your articles $ research fetch # Generate your site # add --download-tailwind if you don't have tailwindcss installed in your $PATH $ research --db ./research.sqlite generate . ``` ## URL Handler Research Pocket includes a custom URL handler for the `research://` protocol. This allows you to save web pages directly from your browser using a bookmarklet. ### Registering the URL Handler To register the URL handler on your system, use the following command: ```sh $ research register ``` This will set up the necessary configurations for your operating system to recognize and handle `research://` URLs. ### Unregistering the URL Handler If you want to remove the URL handler, use: ```sh $ research unregister ``` ### Bookmarklet You can use the following bookmarklet to quickly save web pages to Research Pocket: ```javascript javascript: (function () { var currentUrl = encodeURIComponent(window.location.href); var tags = prompt("Enter tags (comma-separated):", ""); var dbPath = "/path/to/research.sqlite"; if (tags !== null && dbPath !== null) { var encodedTags = encodeURIComponent(tags); var encodedDbPath = encodeURIComponent(dbPath); var researchUrl = `research://save?url=${currentUrl}&provider=local&tags=${encodedTags}&db_path=${encodedDbPath}`; window.location.href = researchUrl; } })(); ``` To use this bookmarklet: 1. Create a new bookmark in your browser. 2. Set the name to something like "Save to Research Pocket". 3. In the URL or location field, paste the above JavaScript code. 4. Replace `/path/to/research.sqlite` with the actual path to your Research Pocket database. Now, when you click this bookmarklet on any web page, it will prompt you for tags and then save the page to your Research Pocket ## Contributing We welcome contributions to ResearchPocket! If you're interested in helping out, here are a few ways you can contribute: - Reporting bugs - Suggesting enhancements - Writing documentation - Submitting pull requests We participate in Hacktoberfest! During October, we encourage contributors to join us in improving ResearchPocket. Look for issues tagged with `hacktoberfest` to get started. For more detailed information about contributing to this project, including our Hacktoberfest participation, please check out our [CONTRIBUTING.md](CONTRIBUTING.md) guide. ## Cli help - Basic Help ```sh RESEARCH 🔖 Manage your reading lists and generate a static site with your saved articles. Usage: research [OPTIONS] [COMMAND] Commands: pocket Pocket related actions local Add a new item to the database stored locally fetch Gets all data from authenticated providers list Lists all items in the database init Initializes the database generate Generate a static site export Export data from the current database handle Handle operations related to the research:// URL scheme help Print this message or the help of the given subcommand(s) Options: --db Database url [env: DATABASE_URL=] [default: ./research.sqlite] -d, --debug... Turn debugging information on -h, --help Print help -V, --version Print version ``` - List ```sh Lists all items in the database Usage: research list [OPTIONS] Options: -t, --tags ... Filter by tags separated by commas Example: --tags rust,sql -l, --limit Limit the number of items to display -f, --favorite-only Favorite items only (Default: false) -h, --help Print help ``` - Init ```sh Initializes the database Usage: research init Arguments: Options: -h, --help Print help ``` - Local ```sh Add a new item to the database stored locally Usage: research local Commands: add Add an item to the local provider in the database list List all items in the local provider favorite Mark an item as favorite in the local provider help Print this message or the help of the given subcommand(s) Options: -h, --help Print help ``` - Pocket ```sh Pocket related actions Usage: research pocket Commands: auth Authenticate using a consumer key fetch Fetch items from pocket add Add an item to pocket favorite Mark an item as favorite in pocket help Print this message or the help of the given subcommand(s) Options: -h, --help Print help ``` - Fetch ```sh Gets all data from authenticated providers Usage: research fetch Options: -h, --help Print help ``` - Generate Here's an example of how to generate a static site: ```sh $ research --db generate --assets ``` Optionally add `--download-tailwind` to download and reuse the `tailwindcss` binary in the assets directory. ```sh Generate a static site Usage: research generate [OPTIONS] Arguments: The path to the output directory Options: --assets Path to required site assets (main.css, search.js, tailwind.config.js) [default: ./assets] --download-tailwind Download Tailwind binary to /tailwindcss if not found -h, --help Print help ```