Last active
August 29, 2015 14:02
-
-
Save AlexArchive/98eaa1c650adafeba789 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Gamertag": "lagkip", | |
"Tier": "Silver", | |
"Avatar": { | |
"Full": "http://avatar.xboxlive.com/avatar/lagkip/avatar-body.png", | |
"Small": "http://avatar.xboxlive.com/avatar/lagkip/avatarpic-s.png", | |
"Large": "http://avatar.xboxlive.com/avatar/lagkip/avatarpic-l.png", | |
"Tile": "http://avatar.xboxlive.com/avatar/Lagkip/avatarpic-l.png" | |
}, | |
"Gamerscore": "395", | |
"Reputation": 60, | |
"Presence": "Offline", | |
"Online": false, | |
"Motto": "None", | |
"Name": "", | |
"Location": "", | |
"Biography": "", | |
"Friends": { | |
"Href": "http://localhost:7820/profile/lagkip/friends" | |
}, | |
"Games": { | |
"Href": "http://localhost:7820/profile/lagkip/games" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProfileModule : ModuleBase | |
{ | |
public ProfileModule() | |
{ | |
Get["/profile/{gamertag}"] = context => | |
{ | |
Profile profile = XboxClient.Profile.GetProfile(context.Gamertag); | |
if (profile == null) | |
return this.ErrorMessage(HttpStatusCode.BadRequest, "Profile does not exist."); | |
dynamic profileDto = profile.ToExpandoObject(); | |
profileDto.Friends = new { Href = "http://localhost:7820/profile/" + context.Gamertag + "/friends"}; | |
profileDto.Games = new { Href = "http://localhost:7820/profile/" + context.Gamertag + "/games" }; | |
return profileDto; | |
}; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment