Update routers/getnews.py
Browse files- routers/getnews.py +3 -0
routers/getnews.py
CHANGED
@@ -13,6 +13,7 @@ query GetNews($first: Int!) {
|
|
13 |
movieNews: news(first: $first, category: MOVIE) {
|
14 |
edges {
|
15 |
node {
|
|
|
16 |
articleTitle { plainText }
|
17 |
externalUrl
|
18 |
date
|
@@ -24,6 +25,7 @@ query GetNews($first: Int!) {
|
|
24 |
tvNews: news(first: $first, category: TV) {
|
25 |
edges {
|
26 |
node {
|
|
|
27 |
articleTitle { plainText }
|
28 |
externalUrl
|
29 |
date
|
@@ -61,6 +63,7 @@ async def get_news(first: int = 15) -> List[Dict]:
|
|
61 |
for edge in data.get(category_key, {}).get("edges", []):
|
62 |
node = edge.get("node", {})
|
63 |
combined.append({
|
|
|
64 |
"title": node.get("articleTitle", {}).get("plainText"),
|
65 |
"url": node.get("externalUrl"),
|
66 |
"date": node.get("date"),
|
|
|
13 |
movieNews: news(first: $first, category: MOVIE) {
|
14 |
edges {
|
15 |
node {
|
16 |
+
id
|
17 |
articleTitle { plainText }
|
18 |
externalUrl
|
19 |
date
|
|
|
25 |
tvNews: news(first: $first, category: TV) {
|
26 |
edges {
|
27 |
node {
|
28 |
+
id
|
29 |
articleTitle { plainText }
|
30 |
externalUrl
|
31 |
date
|
|
|
63 |
for edge in data.get(category_key, {}).get("edges", []):
|
64 |
node = edge.get("node", {})
|
65 |
combined.append({
|
66 |
+
"id": node.get("id"),
|
67 |
"title": node.get("articleTitle", {}).get("plainText"),
|
68 |
"url": node.get("externalUrl"),
|
69 |
"date": node.get("date"),
|