Linux Python client for Inoreader notifications
 
 
Go to file
Alexandre Racine 7c3c922529 Set logging process
* Sets logging method and
  replaces basic "print" with
  logs

* Replaces /HOME/USER/.config/ directory
  with /HOME/USER/.inopy directory

* Moves config directory in new /HOME/USER/.inopy
  directory and creates a new "logs" directory

* Adapts README file
2023-07-01 18:07:25 +02:00
icons Program documentation 2023-06-16 22:51:47 +02:00
templates Initial commit 2023-06-08 19:12:28 +02:00
.gitignore Program documentation 2023-06-16 22:51:47 +02:00
COPYING.md Initial commit 2023-06-08 19:12:28 +02:00
README.md Set logging process 2023-07-01 18:07:25 +02:00
config.py Set logging process 2023-07-01 18:07:25 +02:00
ino.py Set logging process 2023-07-01 18:07:25 +02:00
logs.py Set logging process 2023-07-01 18:07:25 +02:00
notif.py Program documentation 2023-06-16 22:51:47 +02:00
oauth.py Set logging process 2023-07-01 18:07:25 +02:00
refresh.py Set logging process 2023-07-01 18:07:25 +02:00

README.md

Inopy

Inopy is a Python application that retrieves unread articles from the Inoreader API and sends a notification if there are any.

Table of Contents

Overview

It uses OAuth authentication for accessing the API and stores the authentication data in a JSON configuration file located at /HOME/USER/.inopy/config/config.json. The program is divided into multiple modules and functions for making API requests, parsing response data, refreshing tokens, sending notifications and logging the processes.

The code is organized into the following modules:

  • ino.py: The main module that retrieves unread articles, handles token refreshing, and sends notifications.
  • config.py: Contains configuration settings used by other modules.
  • oauth.py: Implements the OAuth authentication flow using Flask.
  • refresh.py: Contains a refresh function for refreshing OAuth access and refresh tokens and updating the configuration file.
  • notif.py: Provides a function for sending notifications using D-Bus (only tested with Cinnamon desktop environment).
  • logs.py: Defines logging options.

Installation

To use Inopy, you need to follow these steps:

  1. Install the required dependencies by running the following command:
pip install requests pydbus flask waitress
  1. Clone or download this repository.

  2. Run the ino.py module the first time and set up the configuration file by providing the necessary OAuth, API endpoint and notifications details.

  3. Run the ino.py module to retrieve unread articles and receive notifications.

Usage

The first time ino.py module is run, it will check if config.json exists in /HOME/USER/.inopy/config/. If not it will prompt user for configuration details and create the config.json file. The file should contain the OAuth endpoint, client ID, client secret, callback URL, scope, CSRF value and home URL.

It should also contain the Inoreader API endpoints, notification labels, production status, browser path, host and port.

Once the configuration is set up, you can adapt some of the default values. Typically, check and if necessary adapt the prod section of the file. It defines whether the program is run in production or development mode.

To set a cron in Linux triggering the program for a notification, create a bash script containing the following code

#!/bin/bash
export DISPLAY=:0.0
export XAUTHORITY=/home/user/.Xauthority # adapt with your username
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus

python path_to_your_ino.py # adapt with the path to your program directory

and define the cron job pointing to the bash script created.

License

Inopy is released under the GNU General Public License version 3 or later. You can redistribute it and/or modify it under the terms of the license. For more details, please refer to the GNU General Public License.