Skip to content

Commit

Permalink
parameterized number of days to be pulled
Browse files Browse the repository at this point in the history
  • Loading branch information
Lini Mestar committed Jan 14, 2021
1 parent d508300 commit 7f17062
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
USERNAME=lmestar
CONTAINER_NAME=wz
IMAGE=$(USERNAME)/$(CONTAINER_NAME):0.2
DAYS?=8

all: run

Expand All @@ -17,6 +18,7 @@ up:
-p 5901:5901 \
-v /dev/shm:/dev/shm \
-e USER=${USER} \
-e DAYS=${DAYS} \
-e TZ=America/Los_Angeles \
--name $(CONTAINER_NAME) $(IMAGE) \
bash -c "sleep 2 && python3 wz.py "
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ docker pull lmestar/wz:0.2

### Run
```
make USER=<Enter your PSN username>
make USER=<Enter your PSN username> DAYS=<# of past days to collect>
```

## Visualize
Expand Down
4 changes: 2 additions & 2 deletions wz.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_basics(self):
sleep (1)
pass

for day in range(1,12):
for day in range(1,int(os.getenv('DAYS'))+1):
print(day)
cod_tracker_date = self.driver.find_element_by_xpath('//*[@id="app"]/div[2]/div[2]/div/main/div[2]/div[3]/div[2]/div/div[2]/div['+str(day)+']/div[1]/h3').text.split('\n')[0]
cod_tracker_games_per_day = self.driver.find_element_by_xpath('//*[@id="app"]/div[2]/div[2]/div/main/div[2]/div[3]/div[2]/div/div[2]/div['+str(day)+']/div[1]/h3').text.split('\n')[1]
Expand All @@ -62,7 +62,7 @@ def get_basics(self):
cod_tracker_match_link_list.append(cod_tracker_match_link)

self.driver.quit()

return cod_tracker_games_per_day_list, cod_tracker_date_list, cod_tracker_mode_list, cod_tracker_match_placement_list, cod_tracker_time_list, cod_tracker_kills_list, cod_tracker_damage_list, cod_tracker_match_link_list

class SbmmWz():
Expand Down

0 comments on commit 7f17062

Please sign in to comment.