21
4
This is a simple one. Given the input of a number, return the name and reputation score of the Stack Overflow user with that given ID. Your program can assume that it is always given a valid and existent user ID.
For example: given the input 764357
(which is my userID on StackOverflow) the program would return LegoStormtroopr 3,088
(approximately) it might change.
You get the URL: "https://stackoverflow.com/users/" or "http://api.stackexchange.com/2.1/users/" for free, so your score is length of your program - 31 or 39
, depending on which URL you use - but declare which it is. This prevents people from abusing URL shorteners.
edit: And no calling a custom made API that query Stack Overflow, and returns just the name and score. But if you know of an offical API, then that is totally legitimate.
edit2: If you need an example input: I've given my ID below, feel free to add your own ID, username and score below to help others out. Note again, this is for the main Stack Overflow site.
764357 returns LegoStormtroopr 3,088
hmm... if there are multiple users with that rep, should we pick one, or display all of them? What if there is no such user? – John Dvorak – 2013-10-03T07:47:32.483
2uh... wait... of the user with that score, or of the user with that ID? – John Dvorak – 2013-10-03T07:51:40.693
@JanDvorak I've tried to clarify. The program should accept a user ID, and return the user with that ID, and that users Rep. Score. – None – 2013-10-03T11:16:27.993
The question still says "return the name and reputation score of the Stack Overflow user with that score." – Reinstate Monica – 2013-10-03T11:57:41.053
@WolframH Wow, I am dumb and missed that twice. Fixed now. I hope. – None – 2013-10-03T12:18:44.523
1Should the url
http://api.stackexchange.com/2.1/users/
also be "free" to avoid penalising users of the API? – gnibbler – 2013-10-03T20:10:40.667@gnibbler yes, you can get the official API for free. – None – 2013-10-04T00:05:44.093
1Could we get the
site=stackoverflow
part for free too? – Johannes Kuhn – 2013-10-04T13:18:25.543@JohannesKuhn Sure. Why not – None – 2013-10-07T01:19:21.343