Upvote a Product Hunt launch
TL;DR
About
Product Hunt's upvote button is a toggle. Press it on a launch you already backed from your phone and you have quietly taken that vote back, which is the classic way an agent doing the clicking gets this wrong. So the run reads the vote icon first and presses only when it is empty. Say you keep a list of tools you tried this month, notion/notion-mail among them, and have your agent back each one from your own account. That is one run per launch. already_present comes back true for the ones you had voted on before, and scoreAfter carries the total Product Hunt returned with your vote, which can differ from scoreBefore plus one because other people vote at the same time. The check rests on the filled icon the site draws today, so a redesign can mean errors, or at worst a press that undoes an existing vote before the run reports the failure.
Input
launch requiredFull launch URL (e.g. "https://www.producthunt.com/products/notion/launches/notion-mail") or a "product/launch" slug pair (e.g. "notion/notion-mail").
Output
hasVoted requiredWhether the account holds an upvote on this launch after the run. True on success.
launchUrl requiredaccount_used requiredHandle of the account that voted, read from the signed-in session rather than assumed.
already_present requiredTrue when this account had already upvoted the launch, so nothing was pressed.
verified_on_page requiredTrue when Product Hunt's own response for the vote confirmed the launch is now upvoted.
postId optionalProduct Hunt's numeric id for the launch that was voted on.
scoreAfter optionalScore Product Hunt reported with the vote. Other people vote continuously, so this is their number at that instant, not necessarily scoreBefore + 1.
scoreBefore optionalScore shown on the control before voting. Read from the rendered figure, so it can lag other people's votes by moments.
Example output
Shape only: placeholder values generated from the output schema, not a real run.
{
"postId": "abc123",
"hasVoted": true,
"launchUrl": "https://example.com/item/123",
"scoreAfter": 3.5,
"scoreBefore": 3.5,
"account_used": "…",
"already_present": true,
"verified_on_page": true
}