zeldor.biz

Linux, programming and more

Copyright © 2025
Log in

Tiny Tiny RSS reading stats

October 29, 2019 by Igor Drobot Leave a Comment

I wrote since 2013 a lot [1][2] about self hosted Tiny Tiny RSS Feed reader and this one is still alive and rung pretty smoothly :)

A couple weeks ago a wrote the following dirty-python-script to read out over the Tiny Tiny RSS API the amount of unread feeds for better reading control. The output of it is running into telegraf which sends the data to an influxdb which can be pretty visualised by grafana.

If you run Tiny Tiny RSS, probably this can be useful for you ;)

import requests
import json
import sys

url = 'https://ttrss.example/api/'
session_payload = {"op":"login","user":"YOURUSER","password":"YOURPASSWORD"}

try:
    r = requests.post(url, data=json.dumps(session_payload))
except:
    print('Could not connect to: ', url)
    sys.exit(0)

if r.status_code == 200:
    session_id = r.json()['content']['session_id']
    if session_id:
        login_payload = {"sid":session_id,"op":"getUnread"}
        r = requests.post(url, data=json.dumps(login_payload))

        if r.status_code == 200:
            unread = r.json()['content']['unread']
            print("ttrss,datacenter=uk-east01,host=system.example.com unread_articles=%s" % unread)

Official documentation provides also a pretty Tiny Tiny RSS API deep description.

Filed Under: Linux Tagged With: grafana, influxdb, Python, RSS, Tiny Tiny RSS

Categories

Archives

Tags

apache2 Apple arduino ARM Automation backup bash Cisco Cluster Corosync Database Debian Debian squeeze DIY DNS Fedora FTP Fun Icinga Ipv6 KVM Linux LVM MAC OS X Monitoring MySQL Nagios Nginx openSUSE OpenVPN PHP Proxy Python python3 qemu RAID rsync Samba security ssh Ubuntu virtualization Windows Windows 7 Wordpress

Leave a Reply

Your email address will not be published. Required fields are marked *

Yeaaah Cookie! We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok