Normally, I'd open with some flavor text here about being bored and/or lazy but looking through the stack-exchange-api questions that would be far from original. So instead I'm going to open with a meta and self-referential flavor text describing this lack of originality that then describes itself and how meta and self-referential it is.
Write a program that takes in the ID for some question on PPCG, and uses the SE API to grab the answers and select the winner.
You may assume that it is a code-golf question, and the following answer format:
# Language, [<s>XXX</s>] YYY bytes [Thanks to @user1 for saving XX bytes!] [Thanks to @user2 for saving YY bytes!] print "badly formatted but easier to tally like this"
- It might have 1 or more attributions or crossed out past scores, and it might not.
- The attributions and crossed-out scores are not necessarily correlated; one can appear without the other.
- If there are no attributions, then the code will start 2 newlines after the heading.
Anyway, you can either extract the length in the beginning or count the length of the code at the end. For the former, only use the last score. For the latter, don't count the attributions. You can assume that the two will match up.
Your program should spit out the ID for the answer with the fewest bytes. Your program should also do this in the fewest bytes possible, as the shortest answer in bytes will win.
Note: yes, I have seen Write code to determine the accepted answer, but that challenge has submissions voting on the winner whereas this is code golf with a specific task and an explicit winner independent of other answers.