Update everything to work with new API + Reorganize file structurem functions and common logic

This commit is contained in:
Vxrtrauter
2025-10-09 22:12:10 +02:00
parent 53b2bb912e
commit 62b8506d13
7 changed files with 64 additions and 56 deletions
+14 -6
View File
@@ -1,10 +1,18 @@
def split_data(data):
json = json.loads(data)
import json
count = json["count"]
posts = json["data"]
query = json["query"]
success = json["success"]
def split_data(data):
p_json = json.loads(data)
count = p_json["count"]
posts = p_json["data"]
query = p_json["query"]
success = p_json["success"]
return count, posts, query, success
def format_data(data):
post_titles = [post["title"] for post in data]
post_links = [post["url"] for post in data]
return post_titles, post_links