From 36bb4a1b3c3bfe5a98ac0ecbc4a6deba3f44078a Mon Sep 17 00:00:00 2001 From: akanksha Date: Fri, 19 Apr 2024 19:17:47 +0530 Subject: [PATCH] update --- .github/workflows/actions.yml | 4 +-- project/app2.py | 64 ----------------------------------- 2 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 project/app2.py diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 97d6276..9f59683 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -2,8 +2,8 @@ name: Run Scripts on: schedule: - # Run newday.py every day at 1:345 pm IST (8:15 am UTC) - - cron: '45 5 * * *' + # Run newday.py every day at 7:20 pm IST (1:50 pm UTC) + - cron: '50 13 * * *' # Run update_BoW.py on the 1st of every month at 1:00 am IST (7:30 pm UTC, last minute of the month) - cron: '0 19 1 * *' diff --git a/project/app2.py b/project/app2.py deleted file mode 100644 index 2b0c21c..0000000 --- a/project/app2.py +++ /dev/null @@ -1,64 +0,0 @@ -import streamlit as st -import pandas as pd -from gtts import gTTS -import os - -vidno=0 -st.set_page_config(layout="wide") -st.write(f"# News Articles") -# Define CSV file paths for each category -category_csv_files = { - 'India': "india.csv", - 'World': "world.csv", - 'Business': "business.csv", - 'Technology': "tech.csv", - 'Sports': "sports.csv" -} - -# Dropdown menu for category selection -selected_category = st.selectbox('Select Category', ['India', 'World', 'Business', 'Technology', 'Sports']) -st.write(f"## {selected_category}") -# Read the CSV file based on the selected category -csv_file = category_csv_files[selected_category] -df = pd.read_csv(csv_file) - -# Display containers for each news article - -for i in range(min(50, len(df))): - article_title = df.iloc[i]['Article Title'] - article_summary = df.iloc[i]['Article Summary'] - article_link = df.iloc[i]['Article Link'] - article_image = df.iloc[i]['Article Image'] - - # Check if all required fields are not empty and valid - if all(isinstance(field, str) and field.strip() for field in [article_title, article_summary, article_link, article_image]): - # Display article container - col1, col2 = st.columns([1, 3]) - with col1: - st.write("") - st.write("") - st.image(article_image, width=250) # Display article image on the left side with specified height and width - # Display "Read Full Article" button - st.write(f"[Read Full Article]({article_link})") - with col2: - st.write(f"### {article_title}") - st.write(article_summary) - - # Display "Convert to Audio" button - convert_button_key = f"convert_button_{i}" - if st.button("Convert to Audio", key=convert_button_key): - # Convert summarized text to audio - audio_filename = f"{vidno}_summary_audio.mp3" - vidno=vidno+1 - tts = gTTS(article_summary, lang='en-uk') - tts.save(audio_filename) - st.audio(audio_filename, format='audio/mp3') - - # Remove audio file after playing - if os.path.exists(audio_filename): - os.remove(audio_filename) - print(article_title, "- Audio file deleted") - st.write("") - st.write("") - else: - print("One or more required fields are empty or invalid. Skipping article display.")