mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 09:59:41 +02:00
Update everything to work with new API + Reorganize file structurem functions and common logic
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user