Coder Social home page Coder Social logo

github2017luo / apple-store-stock-notifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fjwillemsen/apple-store-stock-notifier

1.0 0.0 0.0 58 KB

Apple Store Stock Notifier monitors the availability of selected Apple devices in selected Apple stores, and sends you a notification when devices are available!

License: MIT License

Python 100.00%

apple-store-stock-notifier's Introduction

Apple Store Stock Notifier

This software will immediately send you a notification via Telegram when one of your coveted Apple Devices is available in the selected Apple Stores! In addition, it offers various tools (such as graphs) to analyze the availability of the selected devices from the comfort of your smartphone / tablet / teapot / desktop etc. (whatever Telegram runs on). It is intended to run on an always-on device (such as a Raspberry Pi), and requires an internet connection and a Telegram account.

This software is built on a modified version of Apple-Store-Reserve-Monitor by insanoid.

Installation

How to install

  1. Clone this repository and cd to it.
  2. Execute pip install -r requirements.txt.
  3. Adapt the config.json file to your needs (see under "use").
  4. Create a Telegram bot to inform you and enter the required details in parameters.py.
  5. Run the monitor with python monitor.py.
  6. (optional) Send /setcommands to the Telegram Botfather chat, select the bot and send the output under "Commands available:" to make the commands easily accessible from the chat.

Running the pip numpy on the Raspberry Pi can be cumbersome. If you get errors pertaining to "Importing the numpy C-extensions failed", try running sudo apt-get install python-dev libatlas-base-dev.

Use

It's as simple as entering the device and Apple Store you want in config.json and running python module.py. The model in config.json is the model part number, that can be looked up here. The store in config.json is the store ID, a list of which can be looked up here, defaults to all stores in the zip-code region. config.json is part of the interface of Apple Store Reserve Monitor, more information on how to use this here.

You can change the parameters regarding intervals, paths, use of proxies etc. from the defaults in parameters.py.

It is recommended to run this on a computer that is always on and always has an active internet connection (think of the environment when doing this!). Raspberry Pi and similar computing boards are often good choices. You may want to set up a job to start this automatically using crontab or bashrc if you are running this on a Raspberry Pi, so it can run autonomously.

Please use this software responsibly! Do not set a low polling interval, both for your own benefit (you will be blocked) as for the other users of Apple's service. In general, the defaults set are fine for being notified in time. The intended use is for people to be able to get an Apple device that is often out of stock for their own use. Do not use this software for scalping, price gouging or any other use that is unethical.

Proxies

Randomized proxies help you make requests for a prolonged period of time without your IP-address being blocked by Apple's server. For this http-request-randomizer by pgaref (licensed under MIT license) is used. If randomized proxies are enabled in parameters.py, a list of free proxies will be generated. When a request is made, a random proxy is selected from this list. If the proxy does not return a response within the timeout window, the proxy is removed from the list. Because free proxies are often slow and unreliable, for each request, it will fallback to a non-proxied request after attempting a proxy unsuccesfully. However, because unresponsive proxies are removed from the list, in most cases this random proxy system becomes reliable after a while. Keep in mind that free proxies only remain active for a very short time (days or even hours), so if this program is ran for a long time, the list will become empty, at which point it reloads the proxy list. Using the randomized proxies is significantly slower than direct requests, but prevent your IP address from being blocked.

Licensing

This software builts on other open source software. As such, it is MIT licensed.

apple-store-stock-notifier's People

Contributors

fjwillemsen avatar sfnesbit avatar

Stargazers

 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.