Using Steam Web API to generate a small widget with account statistics
PHP HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cache
icons
templates
.gitignore
LICENSE
README.md
index.php
steam-header.inc

README.md

Steam profile widget

Use Steam Web API to generate a small widget with account statistics (with caching)

Project contains 2 templates, one HTML and one image; HTML widget Image widget

Warning code is somewhat sloppy, partially commented, and there is little-to-no error handling.

Article/Tutorial for this project (link to my blog)

Installation

  • Edit steam-header.inc set $api_key to your Steam Web API key
  • Upload to server
  • Give write permissions on cache/ folder, .html cache will be saved there
  • Give write permissions on icons/ folder, game icons/images will be saved there

GET Variables

  • debug if set, skips cache
  • t type of widget/output (1 = HTML, 2 = PNG image)
  • w width (default 248px for HTML, 640px for image)
  • h height (default 280px for HTML, 96px for image)
  • f image file format (only PNG for now)
  • c count of games to show (in HTML output)
  • p Steam profile URL, ID or nick

Information

Set GET variable debug if you want to skip cache.

Cache is kept for 1 hour

steam-header.inc contains the Steam Web API calls index.php entry point, calls steam-header.inc to get data, handles templating

Templates

templates folder contains templates, here you change the appearance of the widget Edit main.inc, minify it to main.min.inc and it will be used. If main.min.inc doesn't exist, main.inc is used as template.