GithubHelp home page GithubHelp logo

pgaspar / ps5_watcher Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 28 KB

Check online stores for PS5 pre-order availability.

License: MIT License

Shell 0.98% Ruby 99.02%
ps5 scraper pre-orders ruby ps5-watcher hacktoberfest

ps5_watcher's Introduction

Ps5Watcher

stores.yml Validation Status CI Status

PS5 Watcher checks PlayStation 5 inventory in the stores defined in stores.yml and notifies you via Pushover if there are changes.

Installation

For now, to use this code you need to clone the repository and add your own .env file, based on .env.example. This is where you set up your Pushover credentials so you can get notified on your phone.

After checking out the repo, run bin/setup to install dependencies.

Usage

Start the watcher by running the ps5_watcher executable. This will query the stores every 5 minutes.

$ bin/ps5_watcher

Supporting other stores

I appreciate Pull Requests adding add other stores to stores.yml. Here's a quick description of the fields:

  • id: A unique string identifying this store. I'm currently using this format: <store_name>_<country>_<digital or standard PS5 edition>
  • product_url: The URL of the product listing you want the watcher to check
  • selector: The CSS selector for finding the unavailable text
  • unavailable_text: The text the code will look for inside the CSS selector

If the webpage supports jQuery you can try to see if your selector and unavailable_text works by running this on the page:

jQuery(selector).first().text().includes(unavailable_text);

If the product is unavailable, this should return true.

Note: Please make sure you run bin/validator to verify that the stores.yml file looks as expected before opening a Pull Request.

TODO

If other people use this code I'll probably work on these improvements:

  • Allow store filtering from the command line
  • Add other notifiers besides Pushover
  • Possibly add a few extra fields to stores.yml like the country and digital/standard edition
  • Release the code as a gem, still allowing configuration - like the pushover user keys, etc, the selected notifier, etc.
  • Consider ways for regular users to define their own stores without needing to add them to this Github repo.

This code is mostly generic - you can use this to check availability of other products, not just PS5. It might be interesting to make this a generic product stock watcher.

Development

Run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/pgaspar/ps5_watcher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Code of Conduct

Everyone interacting in the Ps5Watcher project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

ps5_watcher's People

Contributors

pgaspar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mansiojha

ps5_watcher's Issues

Win 10 install

Hi, is it possible to run it on win 10? I still got this error after run command bin/ps5_watcher:

fatal: not a git repository (or any parent up to mount point /mnt)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
/mnt/c/users/xxx/Desktop/ps5watcher/lib/ps5_watcher/watcher.rb:5:in `initialize': wrong number of arguments (given 1, expected 0) (ArgumentError)
        from /mnt/c/users/xxx/Desktop/ps5watcher/lib/ps5_watcher.rb:16:in `new'
        from /mnt/c/users/xxx/Desktop/ps5watcher/lib/ps5_watcher.rb:16:in `watch'

Thanks a lot!

Questions

Hi,

i have many questions, do you have an email or a discord where we can talk ?

Thank you.

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.