Spaces:
Running
Running
Commit
·
f19bca7
1
Parent(s):
ed86cf5
Create main.py
Browse files
main.py
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Import necessary libraries and modules
|
2 |
+
from scraper import WebScraper
|
3 |
+
from summarizer import ContentSummarizer
|
4 |
+
from newsletter_generator import NewsletterGenerator
|
5 |
+
|
6 |
+
def main():
|
7 |
+
# List of websites to scrape
|
8 |
+
urls = [
|
9 |
+
'https://www.example1.com',
|
10 |
+
'https://www.example2.com',
|
11 |
+
'https://www.example3.com'
|
12 |
+
]
|
13 |
+
|
14 |
+
# Create a WebScraper object and scrape the websites
|
15 |
+
scraper = WebScraper(urls)
|
16 |
+
scraper.scrape()
|
17 |
+
|
18 |
+
# Get the scraped data
|
19 |
+
data = scraper.get_data()
|
20 |
+
|
21 |
+
# Create a ContentSummarizer object and summarize the content
|
22 |
+
summarizer = ContentSummarizer(data)
|
23 |
+
summaries = summarizer.summarize()
|
24 |
+
|
25 |
+
# Create a NewsletterGenerator object and generate the newsletter
|
26 |
+
generator = NewsletterGenerator(summaries)
|
27 |
+
generator.generate_newsletter()
|
28 |
+
|
29 |
+
if __name__ == "__main__":
|
30 |
+
main()
|
31 |
+
```
|