Giter Site home page Giter Site logo

frogswarm / sc-devtracker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from s0me-1/sc-devtracker

0.0 1.0 0.0 49 KB

A simple RSS/Discord Webhook connector written in Python 3.

License: GNU General Public License v3.0

Python 99.64% Shell 0.23% Batchfile 0.12%

sc-devtracker's Introduction

Star Citizen Discord Devtracker (SC-Devtracker)

A simple RSS/Discord Webhook connector written in Python 3.

SC Devtracker Discord Embed Scpectrum SC Devtracker Discord Embed Reddit

Description

The RSS Feed from Developer Tracker is feeding posts whenever a Star Citizen developer post anything on Spectrum or the Star Citizen Subreddit.

SC-Devtracker monitors that feed, parse the latest entry and then send it to the pre-configured Discord Webhook.

Requirements

  • Python 3.7[1]

SC-Devtracker needs the following python packages to work properly:

  • configparser
  • feedparser
  • requests
  • beautifulsoup4
  • six
  • emoji
  • pytz
  • python-dateutil
  • tzlocale

Installation

Clone this repository wherever you like (e.g. /opt/).

git clone [email protected]:s0me-1/sc-devtracker.git
  • Install the requirements if you haven't already satisfied them:
pip3 install -r requirements.txt

Usage

Any Platform

Once a proper config.ini is created, simply run:

python -m sc-devtracker

Once properly started, SC-Devtracker will fetch and send the most recent entry of the RSS Feed to ensure everything is working as expected.

Linux

Run in shell:

./start.sh

Run as a systemd service:

Considering your installation is in /opt/sc-devtracker and the user running this unit is discord.

create a symlink of sc-devtracker.service in /etc/systemd/system/

ln -s /opt/sc-devtracker/sc-devtracker.service /etc/systemd/system/

reload systemd:

systemctl daemon-reload

enable the service and start it:

systemctl enable sc-devtracker
systemctl start sc-devtracker

Windows

Execute start.bat

Configuration

Complete config-exemple.ini and then rename it to config.ini. Here's a description of what you can put there:

  • feed_url: A valid RSS Feed, defaulted to the one from developertracker.com.
  • webhook_url: A valid url pointing to a discord webhook. This is what you need to complete.
  • embed_title (Optionnal): Discord message title displayed each time an embed is sent.
  • embed_color (Optionnal): A decimal color for the embed border in discord. Defaults selects a color depending on the source website (Light Blue for Spectrum, Orange for Reddit).
  • embed_footer_icon_url: Icon displayed in the footer of the discord embeds.
  • show_timezone (Optionnal): If set to Yes, it will show the timezone in UTC Format (See below). Defaults to No. Without show_timezone With show_timezone
  • fetch_delay (Optionnal): The time in seconds between each refresh of the RSS Feed. Defaults to 600 as the RSS Feed is only updated every 10 minutes.
  • locale (Optionnal): The locale used to display the published time of each entry, use the one on the host by default. Must follow the xx_XX format and must be installed on the host machine.
  • timezone (Optionnal): Desired timezone for published dates. Must be a valid pytz Timezone.

This is the content of config-sample.ini:

[rss]
feed_url = https://developertracker.com/star-citizen/rss

[discord]
webhook_url = YOUR_WEBHOOK_URL
embed_title = New post from a SC Dev !
embed_color =
embed_footer_icon_url = https://avatars2.githubusercontent.com/u/7307512
show_timezone =

[general]
fetch_delay =
locale =
timezone =

Future Feature

  • Better parsing of the HTML content by getting it directly from the source websites

Known Bugs

  • DOM coming from the RSS source maybe incorrect (Especially with lists), resulting in excessive new line in some lists after parsing.
  • Code block are not supported by the RSS feed, therefore, they will not show in the discord embed.

Credits

License

GNU General Public License v3.0

Footnotes

  • [1] python-feedparser currently needs to be updated to properly support Python 3.8.
  • [2] The version used in SC-Devtracker is an unofficial version that includes a patch for handling blocquotes properly.

sc-devtracker's People

Contributors

s0me-1 avatar silmerias avatar

Watchers

James Cloos 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.