Scholar Paper Fetcher is a simple application that retrieves recent research papers from Google Scholar, generates their descriptions using a locally running LLM, and displays them either in the terminal or in a minimalistic GUI interface. The app runs automatically every time you unlock your computer, utilizing Hammerspoon and a Lua script.
- Paper Retrieval: Fetches recent papers from Google Scholar.
- Viewing Modes:
- Terminal-based version: Displays paper titles and descriptions directly in the terminal.
- GUI-based version: A user-friendly PyQt6 GUI with buttons to navigate between papers.
- Retrieval-Augmented Generation (RAG): Enhances the descriptions of the papers using a RAG system.
- Automatic Fetching: Automatically retrieves and displays papers upon unlocking the computer via Hammerspoon.
-
Python 3.x
-
Install the required Python packages:
pip3 install tqdm requests beautifulsoup4 PyQt6 langchain FAISS transformers
-
Open Google Chrome and navigate to Google Scholar.
-
Right-click anywhere on the page and select "Inspect."
-
Go to the "Application" tab, then find "Cookies" under the "Storage" section.
-
Copy the cookie data and save it in a JSON file (e.g.,
cookies.json
) on your local machine. The file should look like this:{ "GSP": "", "NID": "", "HSID": "", "SSID": "", "APISID": "", "SAPISID": "", "SID": "" }
-
Download Ollama either using the command line or manually from the website:
curl -fsSL https://ollama.com/install.sh | sh
-
Pull a Large Language Model (the available models are listed here):
ollama pull llama3.2
The terminal-based version fetches papers and displays their titles and descriptions directly in the terminal.
-
Use a Python script to handle fetching papers, generating descriptions, and displaying them in the terminal:
python3 main.py
The GUI version uses PyQt6 to provide a more user-friendly interface where users can swipe between paper descriptions.
-
Use a Python script to fetch papers, generate descriptions, and display them in a PyQt6 window with "Next" and "Previous" buttons:
python3 main_gui.py
You can configure the app to run automatically whenever you unlock your computer using Hammerspoon, a macOS automation tool.
- Install Hammerspoon from its official website.
- Create a Lua script to trigger the app whenever the screen is unlocked. An example is provided in
./lua/init.lua
. - Place the script in the following directory:
~/.hammerspoon/init.lua
. - Save and reload the Hammerspoon configuration.
With this setup, every time you unlock your computer, the script will automatically run and fetch the latest papers from Google Scholar.