Now the API can read anything post-related!
The new endpoints are getPost
and getPostComments
, plus a sightly revised getPostList
. They're all documented on the API page, but you can ask us on IRC if you have any problems.
Here's a small example script (in python) that will print the title of every post in /all/new and whether jobes has commented on them
import requests
posts = requests.get('https://phuks.co/api/getPostList/all/new').json()
for post in posts['posts']:
comments = requests.get('https://phuks.co/api/getPostComments/' + str(post['pid'])).json()
jobesHasPosted = False
for comm in comments['comments']:
if comm['user'] == "jobes":
jobesHasPosted = True
break
print("Post", post['pid'], "Title", post['title'], "JobesPosted:", jobesHasPosted)
MY HEROES