Giter VIP home page Giter VIP logo

inopy's Introduction

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.

inopy's People

Contributors

alerac avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.