Test Post, and New Signup Method

New testing for draft runner. Testing likes on the post correlating to signups.

19 Likes

:scream_cat::scream_cat::scream_cat: Brennan it’s working

5 Likes

Disgraceful, another robot stealing American jobs

16 Likes

Unfortunately signing up can’t be this easy :frowning:

Only can get total number of likes on the entire thread :sob::sob:

1 Like

Any luck with this? https://meta.discourse.org/t/getting-who-liked-a-post-from-the-api/103618/2

2 Likes

ooh good catch, will take a look!

Working code to get users who liked a post:

import requests

DISCOURSE_KEY = ''
DISCOURSE_USERNAME = ''

headers = {"Accept": "application/json; charset=utf-8"}
params = {'api_key': DISCOURSE_KEY, 'api_username': DISCOURSE_USERNAME}

BASE_URL = 'https://www.chiefdelphi.com'
LIKES_PATH = '/post_action_users?id={}&post_action_type_id=2'
POST_ID = 2234548

url = BASE_URL + LIKES_PATH.format(POST_ID)

response = requests.request('GET', url, params=params, headers=headers)
for entry in response.json()['post_action_users']:
    print(entry)

3 Likes