Giter Site home page Giter Site logo

ps4wishlist's Introduction

PS4 Wish List

A live copy of this application is running at beta.ps4wishlist.com There is a large price discrepency between retailers for the same Playstation 4 games. I wanted to build a website where I could check prices on a game, and ask the website to notify me over email if the game's retail price at any store dropped below an inputted price threshold.

Screen Shot

Work In Progress

So far I've given only a few evenings to this project. It needs more work to be functionally useful and reliable No user logged-in features are completed

Please forgive my light documentation

This was a prototyping, lets-learn-python-and-flask project. I wasn't expecting the code to be seen, or worked with, by anyone else. My package documentation is pretty sparse. Please don't take this to mean I don't document my code.

Tech Stack

Database Model

Object Code for the Database Model

I would upgrade to MariaDB if this website was going to have any real users. With SQLAlchemy, this is as simple as changing the DSN string

Checking Prices: The real challenge

Here is prodapi, the price checking module

Three quarters of the work on this project went into the price checking modules. I currently support price lookups to five different online stores. Not every product can be succesfully found, and priced at each store. In some cases, the checked price is for the wrong product. I have a design plan to remedy that bug, but it's not yet in place.

Amazon, Best-Buy and Wal-Mart have public APIs for accessing product information. Target and the Playstation Network store don't.

A note on price caching

The TOS for all price APIs require you do not cache pricing information. Any prices displayed to an end user must be retrieved live, every time. Only basic product information is cached in the database, Prices are live checked. When viewing a game details page, like this one for No Man's Sky, The prices are checked by javascript after the page has loaded. Otherwise, the website would feel very sluggish. You can watch the price matrix populate over a second or so after the page renders.

Amazon Product Advertising API

Python source prodapi/amazon.py

I use the the Amazon Product Advertising API extensively in this website. When a user searches for a game, the search results are generated via the Amazon API. The game images and description text are also provided by amazon.

The game is added to the local database if somebody views it's price details. At this point, we make note of the UPC code, the ASIN, and the game's full official tital.

Amazon advertists different prices for prime members, used products, new product, and other offerings. Selecting the correct price to display from the dozens the API returns is an iffy proposition.

Best Buy

Python source prodapi/bestbuy.py

The Best Buy Developer API allows item look-up via UPC code. This is rather straight forward.

PSN

Python source prodapi/psn.py

The Playstation Network Store is a challenge. These are digital copies of the game, not physical. Sony offers no official API solution to interact with their information. But their entire web infrastructure is built on REST services. Sniffing the HTTP traffic while browsing their store website reveals private api urls for search and product services. These return massive json results. Using the search API, we make our best guess from the search results which returned game is the right one. Then we make note of the PSN_id. We can check the price easily for this game using it's unique PSN identifier in the future.

Target

Python source prodapi/target.py

Target offers a developer API, but they keep it quite private. I wasn't able to gain access. Like with the PSN, I sniffed the HTTP sessions on the target website, and found the REST service used by the javascript on target.com to populate search results. By simulating target.com search-box activity requests to red sky API, I perform a title search for the product and, if an appropriate match is found, make a note of the product's TCID, target's internal product identifier. With the TCID, we can make other requests to determine the current price.

Wal-Mart

Python source prodapi/walmart.py

Wal-mart offers a Developer API, with search by UPC.

The future of PS4 Wish List

If I find myself with an unusal bit of free time, this project is third on my list of pet projects to nurture. That doesn't bode well for the future of ps4wishlist :)

Room for Improvement

  • A Perl rewrite: Perl is always an improvement
  • The python modules should be better documented, using a standard documentation format
  • The python methods should be better documented, using a standard format that IDEs can understand
  • An error logging system needs to be implemented. The website should handle errors more gracefully.
  • Game information could be more carefully cached, to reduce the number of external API requests needed to render pages
  • Documentation on installation and deployment is needed

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.