From 68d18ce46ade9e6c93182ed975c7610e879570ab Mon Sep 17 00:00:00 2001 From: akanksha Date: Sat, 20 Apr 2024 19:18:54 +0530 Subject: [PATCH] update --- .github/workflows/actions.yml | 6 +++--- project/main2.py | 2 +- project/newday.py | 2 +- update_BoW.py | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 5322fde..1b51c45 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -3,9 +3,9 @@ name: Run Scripts on: schedule: # Run newday.py every day. - - cron: '3 13 * * *' + - cron: '52 13 * * *' # Run update_BoW.py every day - - cron: '45 13 * * *' + - cron: '20 14 * * *' jobs: build: @@ -33,7 +33,7 @@ jobs: run: python project/newday.py - name: Execute update_BoW.py (every day) - if: ${{ github.event_name == 'schedule' && github.event.cron == '25 13 * * *' }} + if: ${{github.event.cron == '25 13 * * *' }} run: python update_BoW.py - name: Commit files diff --git a/project/main2.py b/project/main2.py index e5a47bd..c4c0195 100644 --- a/project/main2.py +++ b/project/main2.py @@ -33,7 +33,7 @@ def categorize_articles(all_links): visited_links[link] = domain print(link, " is ", domain) except Exception as e: - print(f"Error downloading article from {link}: {e}") + print(f"Error downloading article from {link}: {e}\n") continue # Continue with the next iteration of the loop # Separate links based on their domains diff --git a/project/newday.py b/project/newday.py index 7e991d4..93a0e60 100644 --- a/project/newday.py +++ b/project/newday.py @@ -3,7 +3,7 @@ import nltk from pathlib import Path nltk.download('punkt') - +nltk.download('stopwords') csv_folder = Path(__file__).resolve().parent # Get the directory of the script files = [ csv_folder/'india.csv', diff --git a/update_BoW.py b/update_BoW.py index 212b6d9..0f80295 100644 --- a/update_BoW.py +++ b/update_BoW.py @@ -9,6 +9,7 @@ from pathlib import Path nltk.download('punkt') +nltk.download('stopwords') # Get the directory of the script csv_folder = Path(__file__).resolve().parent