parent
ccab047c7c
commit
06bd2ef61a
@ -1,2 +1,4 @@
|
||||
venv/
|
||||
.env
|
||||
config.yml
|
||||
__pycache__
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
import requests
|
||||
|
||||
|
||||
class Fetcher:
|
||||
def __init__(self, URL, token):
|
||||
self.URL = URL
|
||||
self.token = token
|
||||
self.headers = {"Authorization": "GoogleLogin auth="+token}
|
||||
self.getUnreadCounts()
|
||||
self.getSubscriptions()
|
||||
|
||||
def getUnreadCounts(self):
|
||||
response = requests.get(self.URL+"/reader/api/0/unread-count?output=json", headers=self.headers)
|
||||
result = dict([(item["id"], (item["count"], item["newestItemTimestampUsec"])) for item in response.json()["unreadcounts"]])
|
||||
self.unreadCounts = result
|
||||
self.categories = [{"id": item, "name": item[13:], "count": self.unreadCounts[item][0]}
|
||||
for item in self.unreadCounts.keys() if item[0:13] == "user/-/label/"]
|
||||
|
||||
def getSubscriptions(self):
|
||||
response = requests.get(self.URL+"/reader/api/0/subscription/list?output=json", headers=self.headers)
|
||||
self.feeds = response.json()["subscriptions"]
|
||||
|
||||
def feedsFromCategory(self, category):
|
||||
return [item for item in self.feeds if item["categories"][0]["id"] == category]
|
||||
@ -1,37 +0,0 @@
|
||||
#app-grid {
|
||||
layout: grid;
|
||||
grid-size: 2;
|
||||
grid-columns: 1fr 2fr;
|
||||
grid-rows: 1fr;
|
||||
}
|
||||
|
||||
#left-container > Static {
|
||||
background: $boost;
|
||||
margin-bottom: 1;
|
||||
}
|
||||
|
||||
#feed-active {
|
||||
color: blue;
|
||||
border: dodgerblue;
|
||||
}
|
||||
|
||||
#feed-nonactive {
|
||||
color: auto;
|
||||
}
|
||||
|
||||
#feed-pane {
|
||||
row-span: 1;
|
||||
background: $panel;
|
||||
border: dodgerblue;
|
||||
}
|
||||
|
||||
#right-pane {
|
||||
background: $panel;
|
||||
border: dodgerblue;
|
||||
}
|
||||
|
||||
#right-pane > Static {
|
||||
margin-bottom: 1;
|
||||
background: $boost;
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue