12
1
Challenge
Given a user's name (not ID, we have that challenge already), output their current reputation and their ID.
Input
Input will be a single string which is the user's username. You may assume that this user exists.
Output
Output will be two integers to either STDOUT or STDERR which will be the user's reputation and the user's ID. They must be in that specific order and can be output in any reasonable format
Specifics
- The reputation output must not be more than 10 minutes out of date.
- Your program may not throw any errors during normal execution
- Standard loopholes apply (including No URL Shorteners)
- If there is more than one user with that username, you may output the stats of any user with that username. This is also why you must output the ID.
- The reputation to be output is the reputation of the user on PPCG, not the network total score.
The Stack Exchange API site can be found here. You can read the documentation from there.
Link the stack-exchange API. – Magic Octopus Urn – 2017-04-19T12:44:11.793
@carusocomputing Will do, thanks. I also need to fix something because apparently multiple users can have the same name. – HyperNeutrino – 2017-04-19T12:45:14.357
I suppose this rule applies? Also, can you confirm that it's the total reputation of the user on PPCG rather than SE?
– Arnauld – 2017-04-19T13:01:04.693@Arnauld I will say yes. And I confirm that it's just the PPCG reputation. I will clarify that in the challenge. Thanks. – HyperNeutrino – 2017-04-19T13:04:35.977
Well I did this T-SQL entry but it doesn't meet rule 1 as it's not updated enough :(
– ʰᵈˑ – 2017-04-19T13:17:41.537@ʰᵈˑ Oh :( That's too bad. Yeah I did that to prevent answers using the cache :P – HyperNeutrino – 2017-04-19T13:20:54.063
Is an answer valid if they output the results for a user whose name just contains the input string instead of having an exact match? – Dason – 2017-04-19T14:21:30.910
Would
{"items":[{"reputation":2820,"user_id":42295}]}
be a reasonable output format? – Tom – 2017-04-19T14:23:40.320@Tom Sure. I will say yes. As long as it's obvious where the data is. – HyperNeutrino – 2017-04-19T14:24:22.657
@HyperNeutrino Any input on the exact match question I had? So let's say your input was "tom" and your answer output was for "Tom Carpenter" would that be acceptable? – Dason – 2017-04-19T14:28:11.907