Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- #------------------------------------------------------------------------------------
- #
- # user_api - a tool to gather information about a chessgames member
- #
- # This is a "safe API", as it only returns information that you could find by going
- # to chessgames.com.
- #
- # Call this API at http://www.chessgames.com/perl/user_api
- #
- # >>> WHAT YOU CAN SEND
- #
- # username = the username requested, case insensitive
- #
- # hashed_password = the hex SHA256 of a string creatd by taking the ALLCAPS
- # version of the username, appending a colon, and then
- # appending the password. For example, if user ChessGuy
- # has password rhonda89 then this should contain
- # SHA256("CHESSGUY:rhonda89")
- #
- # >>> WHAT YOU GET BACK
- #
- # error = 0 no errors
- # 1 no username received (are you sending the parameters?)
- # 2 the username is not on file
- # 3 the password provided does not match
- #
- # username = the username as we have it on file, which may differ
- # from the one you send by capitalization
- #
- # premium = is the user a premium member? 0=false, 1=true
- #
- # avatar = a URL to the user's avatar. Not sent if there is none.
- #
- # The output comes back in JSON format, like this
- #
- # {
- # "error": 0,
- # "error_desc": "NONE",
- # "user": {
- # "username": "Obnoxious Jerk",
- # "premium": "1",
- # "color_light": "EEEEEE",
- # "color_dark": "99CC99",
- # "avatar": "http://www.chessgames.com/av/face_320.gif"
- # }
- # }
- #
- #------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement