I'd like to get the latest posts id from a subreddit. Reddit is have basic api for this. You can get json so i want gives data and decode it but i have a error.
root@archi-sunucu:~/yusuf/www# python3 reddit.py
Traceback (most recent call last):
File "reddit.py", line 24, in <module>
json = json.loads(resp.text())
TypeError: 'str' object is not callable
root@archi-sunucu:~/yusuf/www# python3 reddit.py
my code:
url = "https://www.reddit.com/r/" + subreddit + "/" + feed + ".json?sort=" + feed + "&limit=6"
resp = requests.get(url, verify=False)
json = json.loads(resp.text())
print(json["data"]["children"][0]["data"]["id"])
thanks for helps...
json.loads(resp.text)