Giter Club home page Giter Club logo

favorite-game's Introduction

Favorite Game

This is a web app project for GameBanana which displays on user profiles as a custom module. It shows a favorite game including total hours on record from your Steam profile. It uses the built-in CustomConfig API to store user data directly on GameBanana, and the GetOwnedGames method from the Steam Web API to retrieve game data.

Usage on-site

  1. Go to the app page and click "Install App".
  2. Add the module in your Profile WYSIWYG Editor, or include <?= $d["_aThirdPartyModules"]["_sFavoriteGame"] ?> in your Profile Template.
  3. If using Steam features, set your Steam profile and games library to public.

How to install

Set CORS-related HTTP headers to allow GET requests.

Access-Control-Allow-Origin "https://gamebanana.com"
Access-Control-Allow-Methods "GET"
Access-Control-Allow-Headers "Content-Type"

In module.php set your own domain for the absolute path to steam-api-handler.php, it must be used because the app is embedded directly into GameBanana.

function getSteamData(steamId64, appId, displayHours) {
    return fetch("https://lebdan.zumesite.com/favorite-game/steam-api-handler.php

In steam-api-handler.php set the include to the corresponding file with your API key.

require_once("/home2/lebdanzu/config/config.php"); //STEAM_API_KEY

The API key is declared in config.php.

<?php
    const STEAM_API_KEY = "00000000000000000000000000000000";
?>

Features

The name and preview banner are displayed with a similar design to the favorite game showcase on Steam profiles. Hours played are optional and will be visible if you've linked with a Steam ID.

Steam game Non-Steam game

Detailed control panel accessible with a button that's only displayed for the profile owner. Steam game settings Non-Steam game settings

Generic game is displayed if the module is configured. Default unconfigured game

favorite-game's People

Contributors

seedee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.