StackOverflow reputation using PowerShell

后端 未结 3 497
野的像风
野的像风 2021-02-04 01:02

How can I view my reputation with a PowerShell function ?

3条回答
  •  隐瞒了意图╮
    2021-02-04 01:49

    In Powershell v3 CTP1 it's shorter and easier:

    function Get-StackOverflowReputation {
    param($userID)
      $JSON = (Invoke-WebRequest "http://stackoverflow.com/users/flair/$userid.json").content
      convertfrom-Json $JSON
    }
    

    running

    Get-StackOverflowReputation 1021945
    

    returns:

    id           : 1021945
    gravatarHtml :
    profileUrl   : http://stackoverflow.com/users/1021945/jon-z
    displayName  : jon Z
    reputation   : 1,271
    badgeHtml    : 1●/span>7
    

提交回复
热议问题