lucianopeixoto / SteamFriendsTagger

A simple tool to manually tag steam profiles on your screenshots
GNU General Public License v3.0
3 stars 0 forks source link

Find game names from the appid and show them in the combobox and default location name #6

Open lucianopeixoto opened 7 years ago

lucianopeixoto commented 7 years ago

I've noticed that some games has the wrong name when requested in the API. Example: app 730 name should be Counter-Strike: Global Offensive, but instead, the API returns "gameName": "ValveTestApp260"

http://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v2/?key=A636DB6F0FF6BE7AAEDB25392C99B5B1&appid=730

{
    "game": {
        "gameName": "ValveTestApp260",
        "gameVersion": "238",
        "availableGameStats": {
            "stats": [
                {
                    "name": "total_kills",
                    "defaultvalue": 0,
                    "displayName": "Enemy players killed"
                },
                {
                    "name": "total_deaths",
                    "defaultvalue": 0,
                    "displayName": "Player Deaths"
                },
(...)
lucianopeixoto commented 7 years ago

There's an easy way to do it without using the API:

  1. Access http://store.steampowered.com/app/APP#
  2. Get the HTML file
  3. Find the line containing page's name ([APP NAME] on Steam)
  4. Remove the HTMLs tags and "on Steam" from string.
  5. DONE!

Obs.: Even when the app page asks for age confirmation, the title is already like the app page itself.

To solve the above example (with CS:GO) it would be: http://store.steampowered.com/app/730/ Title: Counter Strike: Global Offensive on Steam

<!DOCTYPE html>
--
  | <html class=" responsive" lang="en">
  | <head>
  | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  | <meta name="viewport" content="width=device-width,initial-scale=1">
  | <meta name="theme-color" content="#171a21">
  | <title>Counter-Strike: Global Offensive on Steam</title>
  | <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
  |  

(...)