Skip to content

Commit

Permalink
fix categories bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shayki5 committed May 18, 2024
1 parent cb82692 commit e67cb24
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/scrape.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,16 @@ jobs:

- name: Update categories
run: |
sudo apt install libxslt-dev libxml2-dev python3-dev
printf "%s\n" "$GOOGLE_JSON" > google.json
python -m pip install --upgrade pip
pip install pyTelegramBotAPI gspread oauth2client
python bot.py
current_day=$(date +%a)
if [ "$current_day" == "Sat" ]; then
echo "It's Shabbat, not update categories."
else
sudo apt install libxslt-dev libxml2-dev python3-dev
printf "%s\n" "$GOOGLE_JSON" > google.json
python -m pip install --upgrade pip
pip install pyTelegramBotAPI gspread oauth2client
python categories.py
fi
env:
GOOGLE_JSON: ${{ secrets.GOOGLE_JSON }}
TOKEN: ${{ secrets.TELEGRAM_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion bot.py → categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_data_from_sheets_on_start():
# Print the index
print("Index of the first cell in the last 20 values in column D:", first_cell_index)

for index, value in enumerate(column_d_values, start=first_cell_index+1):
for index, value in enumerate(column_d_values, start=first_cell_index):
corresponding_value_e = sheet.cell(index, 5).value
print(f"name: {value}, category: {corresponding_value_e}")
if corresponding_value_e == "not found":
Expand Down

0 comments on commit e67cb24

Please sign in to comment.