Skip to content

Commit

Permalink
Update steam api url (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
sesposito authored Sep 18, 2023
1 parent f89fd2e commit 068c8ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project are documented below.
The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org).

## [Unreleased]
### Changed
- Use Steam partner API instead of public API for Steam profiles and friends requests.

### Fixed
- Fixed multiple issues found by linter.

Expand Down
4 changes: 2 additions & 2 deletions social/social.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([]
func (c *Client) GetSteamFriends(ctx context.Context, publisherKey, steamId string) ([]SteamProfile, error) {
c.logger.Debug("Getting Steam friends", zap.String("steamId", steamId))

path := fmt.Sprintf("https://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key=%s&steamid=%s&relationship=friend", publisherKey, steamId)
path := fmt.Sprintf("https://partner.steam-api.com/ISteamUser/GetFriendList/v0001/?key=%s&steamid=%s&relationship=friend", publisherKey, steamId)
var steamFriends steamFriendsWrapper
err := c.request(ctx, "steam friends", path, nil, &steamFriends)
if err != nil {
Expand Down Expand Up @@ -621,7 +621,7 @@ func (c *Client) CheckGameCenterID(ctx context.Context, playerID string, bundleI
func (c *Client) GetSteamProfile(ctx context.Context, publisherKey string, appID int, ticket string) (*SteamProfile, error) {
c.logger.Debug("Getting Steam profile", zap.String("publisherKey", publisherKey), zap.Int("appID", appID), zap.String("ticket", ticket))

path := "https://api.steampowered.com/ISteamUserAuth/AuthenticateUserTicket/v1/?format=json" +
path := "https://partner.steam-api.com/ISteamUserAuth/AuthenticateUserTicket/v1/?format=json" +
"&key=" + url.QueryEscape(publisherKey) + "&appid=" + strconv.Itoa(appID) + "&ticket=" + url.QueryEscape(ticket)
var profileWrapper SteamProfileWrapper
err := c.request(ctx, "steam profile", path, nil, &profileWrapper)
Expand Down

0 comments on commit 068c8ad

Please sign in to comment.