GithubHelp home page GithubHelp logo

stuart-bradley / steam_lan_game_finder Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 6.38 MB

Finds multiplayer Steam games common between users

Home Page: http://darkstarone.pythonanywhere.com/

License: MIT License

JavaScript 95.59% Python 1.84% HTML 0.29% CSS 2.28%

steam_lan_game_finder's Introduction

Steam Game List Intersector

Disclaimer

Due to changes to the Steam API, SteamSpy no longer works in the same way it used to, and this piece of software is unlikely to work as intended (since users' libraries are now hidden by default)

Introduction

The Steam Game List Intersector is a web app that uses the Steam API to find multiplayer games that users have in common. The idea is that due to the burgeoning size of Steam libraries (mine is 500+ games), it can be hard to quickly work out which games everyone has in common.

Additionally, because of how the intersections work, the app also displays the games owned by subsets of the users inputted along with the price so that the user(s) not in the subset know how much it would cost to buy without jumping into steam.

Screenshot

Index_View

Usage

In the form field, a user can enter a comma delimited list of Steam IDs in any format (the website displays examples of the formats). Once this is done and submitted, a large amount of processing is done (takes a few seconds for five users).

Once the processing is successful, a carousel appears with a table showing the multiplayer games shared across all users. Moving the carousel brings up different tables showing shared games across different user subsets.

All tables also display pricing information, which can be updated via AJAX if the user thinks it might be out-of-date.

Installation Notes

The app itself is fairly simple, and runs on a small number of technologies:

  • Python (v3.6.3) - Backend.
    • Django (v1.11).
    • steam (v0.8.22) - (Python package that does the Steam API calls).
    • requests (v2.18.4) - (Python package that handles non-Steam API calls).
    • Django-environ (v0.4.4) - (Python package for storing ENV variables).
    • django-webpack-loader (v0.5.0) - (Python package for webpack).
  • Yarn (v1.3.2) - Package management.
  • Webpack (v3.8.1) - Package management.
  • Bootstrap (v4.0.0-beta.2) - Frontend.
  • Font Awesome (v4.7.0) - Frontend (due to Webpack issues Font Awesome is loaded via CDN).

The original plan was to include React for the front end, but the additional complexity didn't seem necessary. This is why Yarn and Webpack are used to load Bootstrap (which could have easily also been done via CDN). Both Yarn and Webpack could be removed for a simpler Python application.

.env

This file should be stored in the steam_lan_game_finder folder:

DEBUG=on
SECRET_KEY= 
# Should be in dj-database-url format: https://github.com/kennethreitz/dj-database-url
DATABASE_URL=mysql://user:password@localhost:3306/schema_name
# Get an API key from https://steamcommunity.com/dev/apikey
STEAM_API_KEY= 

Migration Notes

The second migration file (migrations/0002_seed_games_and_tags.py) has two modes of operation. Controlled by commenting and uncommenting lines 104 and 105. The first mode (and the default) loads a fixture file called fixtures/initial_data.yaml, which is a copy of the database produced by the second method on 2017-11-30.

The second method uses a large number of API calls. A single call gets a list of all Steam Games from steamspy.com, after which the SteamSpy and Steam Store APIs are called approximately thirty two thousand times (with one second between calls to avoid DDoS protection) to get initial tag and pricing information. This method also replaces initial_data.yaml with new data.

This can take a few hours, so when testing it is heavily recommended that the --keepdb tag be used (if this mode is set).

Yarn Build Scripts

Since Webpack build commands can be a bit verbose, the following yarn scripts can be run using yarn run XXX:

 "build": "webpack --config webpack.base.config.js --progress --colors",
 "build-production": "webpack --config webpack.prod.config.js --progress --colors",
 "watch": "webpack --config webpack.base.config.js --watch --progress --colors"

Running As A Standalone Script

SteamLanGameFinder.py is the original script which does not require the full web interface. To use it by itself the requirements are:

To use the file, line 19 must be updated with the API key, which can be procured from here. Once that is done the class can be initialised with a list of Steam IDs, which will return an OrderedDict of intersects in the same format as the main web application uses. Keep in mind these are not formatted nicely, and may require some post-processing.

Additionally, the standalone script does not handle price information, or converting Steam IDs to aliases. These tasks are avoided purely to keep the script fast (as it builds the database everytime it gets run).

steam_lan_game_finder's People

Contributors

stuart-bradley avatar

Stargazers

BCN Rosalind Team avatar

Watchers

James Cloos avatar  avatar

steam_lan_game_finder's Issues

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.