2024-08-22 17:15:51 +00:00
|
|
|
import miniflux
|
|
|
|
import time
|
|
|
|
|
|
|
|
from config import __CONFIG__
|
|
|
|
|
|
|
|
# Authentication using an API token
|
|
|
|
client = miniflux.Client(__CONFIG__['miniflux_host'], api_key=__CONFIG__['miniflux_api'])
|
|
|
|
|
|
|
|
def load_content():
|
|
|
|
for i in range(1,10):
|
|
|
|
try:
|
|
|
|
tmp = client.get_entries(status=['unread'])['entries']
|
|
|
|
print(f"Downloaded {len(tmp)}")
|
|
|
|
return tmp
|
|
|
|
except Exception as e:
|
|
|
|
print(f"Error downloading: {e}")
|
2024-08-27 07:29:16 +00:00
|
|
|
time.sleep(1)
|
2024-08-22 17:15:51 +00:00
|
|
|
return None
|
|
|
|
|
|
|
|
def update(ids):
|
|
|
|
for i in range (1,10):
|
|
|
|
try:
|
|
|
|
client.update_entries(entry_ids=ids, status='read')
|
|
|
|
return True
|
|
|
|
except Exception as e:
|
2024-08-23 07:39:36 +00:00
|
|
|
print(f"Error updating: {e}")
|
2024-08-27 07:29:16 +00:00
|
|
|
time.sleep(1)
|
2024-08-22 17:15:51 +00:00
|
|
|
return False
|
|
|
|
|