77 lines
2.1 KiB
Plaintext
77 lines
2.1 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Day 1 Solution - My Implementation\n",
|
|
"\n",
|
|
"This is my solution to the Day 1 assignment. I've implemented the web scraping and summarization functionality as requested.\n",
|
|
"\n",
|
|
"## Features Implemented:\n",
|
|
"- Web scraping with requests and BeautifulSoup\n",
|
|
"- SSL certificate handling for Windows\n",
|
|
"- OpenAI API integration\n",
|
|
"- Website content summarization\n",
|
|
"- Markdown display formatting\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Environment setup complete!\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# My Day 1 Solution - Imports and Setup\n",
|
|
"import os\n",
|
|
"import ssl\n",
|
|
"import requests\n",
|
|
"from bs4 import BeautifulSoup\n",
|
|
"from urllib.parse import urljoin\n",
|
|
"from IPython.display import Markdown, display\n",
|
|
"from openai import OpenAI\n",
|
|
"from dotenv import load_dotenv\n",
|
|
"\n",
|
|
"# Load environment variables\n",
|
|
"load_dotenv(override=True)\n",
|
|
"\n",
|
|
"# SSL fix for Windows\n",
|
|
"ssl._create_default_https_context = ssl._create_unverified_context\n",
|
|
"os.environ['PYTHONHTTPSVERIFY'] = '0'\n",
|
|
"os.environ['CURL_CA_BUNDLE'] = ''\n",
|
|
"\n",
|
|
"print(\"Environment setup complete!\")\n"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": ".venv",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.12.12"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|