Answer the question
In order to leave comments, you need to log in
How to make a round-the-clock service for downloading files?
Good morning everybody!
Background: there is a certain store (e2e4), on their website you can download a fresh price list (apparently it is created when you click on "download", because it takes about 5-10 seconds before the download starts). Prices change several times a day, I don’t know exactly what time)))
Task: to make a service or a program that will download a file with prices every hour and process it as necessary. Now it's a program written in C# that does everything just fine. But it is necessary that it works around the clock (well, I really like to watch the price dynamics).
There are some web resources so that you can implement something similar there, or at least so that the hourly file download takes place there, and my program will take care of the processing (when you open it, it will load the missing files). Do not offer a dedicated server (expensive)!!!
Answer the question
In order to leave comments, you need to log in
Write software not for Windows, but for Android, Arduino, Raspberry PI, etc., the corresponding hardware is cheap enough to buy another computer of this platform, and now it will work around the clock.
Or rent a VPS on which to run the program, it can be a full-fledged Windows with a remote desktop that provides speed and convenience at the level of a regular Windows PC, but you have to pay.
There are still different "ideas", for example, try a regular free hosting, where to apply CRON if possible, and if not, then create not one, but two scripts that will make requests to each other, thereby "bypassing" the timeout for a while runtime installed on the server. :) But this is no longer guaranteed, and not very convenient.
1. A simple script on the cheapest VPS makes wget or curl of this price list by cron and puts it under different names (with a timestamp) in a separate directory.
2. The script on the localhost connects to the VPS via SCP/SFTP, takes all the prices accumulated there, parses them one by one and adds the result to the database.
Option 1:
1. Rewrite your program in python
2. Upload it to a cheap VPS
3. Set up cron to run every hour.
Option 2:
1. Rewrite your application in a Web Service for Azure (remains in C #)
2. Upload to Azure (about 1 thousand per month)
In a simple case - I would make a wrapper over wget/curl in bash. And pulled it from cron.
In a more complex one, I would separate the load into a console application and check if it works under mono.
If not, I rewrote it in python.
But I think the last 2 options are hardly justified.
And I launched it on some VPS or, if available, a raspberry pi or other single-board.
ps well, yes - it would still be possible to fill it in azure
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question