From 0bbaaa2eade01d47d8e2b04d5498297f645525bd Mon Sep 17 00:00:00 2001 From: KorenLazar Date: Wed, 2 Dec 2020 00:04:52 +0200 Subject: [PATCH] has added README file --- README | 43 +++++++++++++++++++++++++++++++++++++++++++ main.py | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..6e9bc36 --- /dev/null +++ b/README @@ -0,0 +1,43 @@ +# Shufersal basic scraping + +## Installation +clone: +```shell script +git clone https://github.cs.huji.ac.il/danieljannai/cryptocurrencies-project +cd cryptocurrencies-project +virtualenv venv +source venv/bin/activate +pip install -r requirements.txt +``` + +## Simulator + +This app simulates a bitcoin network with many transactions resulting in a bloated blockchain. When the `--evil` +flag is enabled, one of the nodes will commence an attack on some of the blocks, resulting in a lower fee rate +in spite of the blockchain being full. + +## Dependencies + +1. python (3.7+) +2. virtualenv + +## Usage +First, to find your store's id, you can run the following command (assuming you live in Jerusalem): +```shell script +python main.py --find_store ירושלים +``` +After running the command, you'll be able to see the different stores in Jerusalem with their ids in "stores_ירושלים.log". + +Now, that we have the store's id, we can get its promotions sorted by their update date by running: +```shell script +python main.py --promos 5 +``` +* We assumed that the store's id is 5. +Now, you can find the promos in promos_5.log. + +For other documentation and commands, you can run +```shell script +python main.py --h +``` + +Good luck! \ No newline at end of file diff --git a/main.py b/main.py index 747f85c..a497f81 100644 --- a/main.py +++ b/main.py @@ -44,7 +44,7 @@ class Promotion: def __str__(self): items = '\n'.join(str(item) for item in self.code_items) - return f"*** {self.content} until {self.end_date.date()} ***\n{items}\n" + return f"*** {self.content} until {self.end_date.date()} update in {self.update_date} ***\n{items}\n" def get_download_url(store_id: int, cat_id: int) -> str: