├── .gitignore ├── News-Aggregator ├── NewsAggregator │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-311.pyc │ │ ├── __init__.cpython-38.pyc │ │ ├── settings.cpython-311.pyc │ │ ├── settings.cpython-38.pyc │ │ ├── urls.cpython-311.pyc │ │ ├── urls.cpython-38.pyc │ │ ├── wsgi.cpython-311.pyc │ │ └── wsgi.cpython-38.pyc │ ├── asgi.py │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── db.sqlite3 ├── manage.py ├── news │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-311.pyc │ │ ├── __init__.cpython-38.pyc │ │ ├── admin.cpython-311.pyc │ │ ├── admin.cpython-38.pyc │ │ ├── apps.cpython-311.pyc │ │ ├── models.cpython-311.pyc │ │ ├── models.cpython-38.pyc │ │ ├── urls.cpython-311.pyc │ │ ├── urls.cpython-38.pyc │ │ ├── views.cpython-311.pyc │ │ └── views.cpython-38.pyc │ ├── admin.py │ ├── apps.py │ ├── migrations │ │ ├── 0001_initial.py │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── 0001_initial.cpython-311.pyc │ │ │ ├── 0001_initial.cpython-38.pyc │ │ │ ├── __init__.cpython-311.pyc │ │ │ └── __init__.cpython-38.pyc │ ├── models.py │ ├── templates │ │ └── news │ │ │ └── home.html │ ├── tests.py │ ├── urls.py │ └── views.py └── requirements.txt ├── README.md └── screenshots ├── Options_select.PNG ├── breaking_light_mode.PNG ├── breaking_night_mode.PNG ├── copy_to_clipboard.PNG ├── entertainment_light_mode.PNG ├── entertainment_night_mode.PNG ├── facebook_share.PNG ├── latest_light_mode.PNG ├── latest_night_mode.PNG ├── opinion_light_mode.PNG ├── opinion_night_mode.PNG ├── polititcs_light_mode.PNG ├── polititcs_night_mode.PNG ├── sports_light_mode.PNG ├── sports_night_mode.PNG ├── ss.PNG ├── ss1.PNG ├── telegram_share.PNG └── whatsapp_share.PNG /.gitignore: -------------------------------------------------------------------------------- 1 | *.db 2 | *.sqlite3 3 | -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/NewsAggregator/__init__.py -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/NewsAggregator/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/NewsAggregator/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/__pycache__/settings.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/NewsAggregator/__pycache__/settings.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/__pycache__/settings.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/NewsAggregator/__pycache__/settings.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/__pycache__/urls.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/NewsAggregator/__pycache__/urls.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/NewsAggregator/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/__pycache__/wsgi.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/NewsAggregator/__pycache__/wsgi.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/__pycache__/wsgi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/NewsAggregator/__pycache__/wsgi.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for NewsAggregator project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'NewsAggregator.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for NewsAggregator project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.2. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | TEMPLATE_DIR=os.path.join(BASE_DIR,'news/templates/news').replace('\\','/') 18 | 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = 'xe4hmfwal+58e7@8u@&g^x2xsow_hyv7%m3wmk^o4u(%+!73cw' 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = True 28 | 29 | ALLOWED_HOSTS = ['*'] 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | 'django.contrib.admin', 36 | 'django.contrib.auth', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.sessions', 39 | 'django.contrib.messages', 40 | 'django.contrib.staticfiles', 41 | 'news', 42 | 'django_social_share' 43 | ] 44 | 45 | MIDDLEWARE = [ 46 | 'django.middleware.security.SecurityMiddleware', 47 | 'django.contrib.sessions.middleware.SessionMiddleware', 48 | 'django.middleware.common.CommonMiddleware', 49 | 'django.middleware.csrf.CsrfViewMiddleware', 50 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 51 | 'django.contrib.messages.middleware.MessageMiddleware', 52 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 53 | ] 54 | 55 | ROOT_URLCONF = 'NewsAggregator.urls' 56 | 57 | TEMPLATES = [ 58 | { 59 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 60 | 'DIRS': [TEMPLATE_DIR], 61 | 'APP_DIRS': True, 62 | 'OPTIONS': { 63 | 'context_processors': [ 64 | 'django.template.context_processors.debug', 65 | 'django.template.context_processors.request', 66 | 'django.contrib.auth.context_processors.auth', 67 | 'django.contrib.messages.context_processors.messages', 68 | ], 69 | }, 70 | }, 71 | ] 72 | 73 | WSGI_APPLICATION = 'NewsAggregator.wsgi.application' 74 | 75 | 76 | # Database 77 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 78 | 79 | DATABASES = { 80 | 'default': { 81 | 'ENGINE': 'django.db.backends.sqlite3', 82 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 83 | } 84 | } 85 | 86 | 87 | # Password validation 88 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 89 | 90 | AUTH_PASSWORD_VALIDATORS = [ 91 | { 92 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 93 | }, 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 102 | }, 103 | ] 104 | 105 | 106 | # Internationalization 107 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 108 | 109 | LANGUAGE_CODE = 'en-us' 110 | 111 | TIME_ZONE = 'UTC' 112 | 113 | USE_I18N = True 114 | 115 | USE_L10N = True 116 | 117 | USE_TZ = True 118 | 119 | 120 | # Static files (CSS, JavaScript, Images) 121 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 122 | 123 | STATIC_URL = '/static/' 124 | -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/urls.py: -------------------------------------------------------------------------------- 1 | """NewsAggregator URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path,include 18 | 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | path('',include("news.urls")), 22 | ] 23 | -------------------------------------------------------------------------------- /News-Aggregator/NewsAggregator/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for NewsAggregator project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'NewsAggregator.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /News-Aggregator/db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/db.sqlite3 -------------------------------------------------------------------------------- /News-Aggregator/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'NewsAggregator.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /News-Aggregator/news/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__init__.py -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/admin.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/admin.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/apps.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/apps.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/models.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/models.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/urls.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/urls.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/views.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/views.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/__pycache__/views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/__pycache__/views.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /News-Aggregator/news/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class NewsConfig(AppConfig): 5 | name = 'news' 6 | -------------------------------------------------------------------------------- /News-Aggregator/news/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.2 on 2020-03-26 19:51 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Headline', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('title', models.CharField(max_length=200)), 19 | ('image', models.URLField(blank=True, null=True)), 20 | ('url', models.TextField()), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /News-Aggregator/news/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/migrations/__init__.py -------------------------------------------------------------------------------- /News-Aggregator/news/migrations/__pycache__/0001_initial.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/migrations/__pycache__/0001_initial.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/migrations/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/migrations/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/News-Aggregator/news/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /News-Aggregator/news/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | 5 | class Headline(models.Model): 6 | title = models.CharField(max_length=200) 7 | image = models.URLField(null=True, blank=True) 8 | url = models.TextField() 9 | def __str__(self): 10 | return self.title -------------------------------------------------------------------------------- /News-Aggregator/news/templates/news/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | News Aggregator 5 | 9 | 15 | 16 | 17 | 18 | 31 | {% load social_share %} 32 |
33 |
34 |
35 |

News Aggregator

36 | 72 | 78 |
79 |
80 | 81 |
82 | {% for object in object_list %} 83 |
84 |
85 | 86 | 93 | 137 |
138 |
139 | {% endfor %} 140 |
141 |
142 | 143 | {% comment %} Copy to Clipboard {% endcomment %} 144 | 159 | 164 | 169 | 174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /News-Aggregator/news/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /News-Aggregator/news/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from news.views import scrape, news_list 3 | urlpatterns = [ 4 | path('scrape/', scrape, name="scrape"), 5 | path('', news_list, name="home"), 6 | ] -------------------------------------------------------------------------------- /News-Aggregator/news/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | import requests 3 | from django.shortcuts import render, redirect 4 | from bs4 import BeautifulSoup as BSoup 5 | from news.models import Headline 6 | 7 | # Create your views here. 8 | 9 | 10 | def scrape(request, name): 11 | Headline.objects.all().delete() 12 | session = requests.Session() 13 | session.headers = {"User-Agent": "Googlebot/2.1 (+http://www.google.com/bot.html)"} 14 | url = f"https://www.theonion.com/{name}" 15 | content = session.get(url).content 16 | soup = BSoup(content, "html.parser") 17 | 18 | News = soup.find_all("div", {"class": "sc-cw4lnv-13 hHSpAQ"}) 19 | 20 | for article in News: 21 | main = article.find_all("a", href=True) 22 | 23 | linkx = article.find("a", {"class": "sc-1out364-0 dPMosf js_link"}) 24 | link = linkx["href"] 25 | 26 | titlex = article.find("h2", {"class": "sc-759qgu-0 cvZkKd sc-cw4lnv-6 TLSoz"}) 27 | title = titlex.text 28 | 29 | imgx = article.find("img")["data-src"] 30 | 31 | new_headline = Headline() 32 | new_headline.title = title 33 | new_headline.url = link 34 | new_headline.image = imgx 35 | new_headline.save() 36 | return redirect("../") 37 | 38 | 39 | def news_list(request): 40 | headlines = Headline.objects.all()[::-1] 41 | context = { 42 | "object_list": headlines, 43 | } 44 | return render(request, "news/home.html", context) 45 | -------------------------------------------------------------------------------- /News-Aggregator/requirements.txt: -------------------------------------------------------------------------------- 1 | asgiref==3.7.2 2 | beautifulsoup4==4.12.2 3 | bs4==0.0.1 4 | certifi==2023.7.22 5 | charset-normalizer==3.2.0 6 | Django==3.2.21 7 | django-social-share==2.3.0 8 | gunicorn==21.2.0 9 | idna==3.4 10 | packaging==23.1 11 | requests==2.31.0 12 | soupsieve==2.4.1 13 | sqlparse==0.4.4 14 | tzdata==2023.3 15 | urllib3==2.0.4 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Website Live Link 2 | https://news-aggregator-ku26.onrender.com/ 3 | 4 |

5 |

News Aggregator

6 |
7 | 8 |
9 | 10 | [![](https://img.shields.io/badge/Made_with-Python3-blue?style=for-the-badge&logo=python)](https://www.python.org "Python3")[![](https://img.shields.io/badge/Made_with-Django-blue?style=for-the-badge&logo=django)](https://www.djangoproject.com/ "Django") 11 | 12 |

13 | 14 | ## Description 15 | 16 | News aggregator is a Django project to scrape a news website using Beautiful soup and request module and hence combination of web crawlers and web applications. 17 | Both of these technologies have their implementation in Python. 18 | 19 | ## Features 20 | 21 | Our news aggregator works in 3 steps:
22 | 1.It scrapes the news website for the articles.In this Django project, we are scraping a website 'www.theonion.com'
23 | (We have scraped news articles from 'latest' section of 'www.theonion.com' for demonstration)
24 | 2.Then it stores the article’s images, links, and title.
25 | 3.The stored objects in the database are served to the client. The client gets information in a nice template by clicking the 'Load news' button and select the different options available to you.The options are: Latest,Entertainment,Sports,Politics,Opinion,Breaking-News
26 | 27 | ---------------------------------------------------------------------------------------- 28 | ### Screenshots ### 29 | ## Latest 30 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/latest_light_mode.PNG) 31 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/latest_night_mode.PNG) 32 | ## Entertainment 33 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/entertainment_light_mode.PNG) 34 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/entertainment_night_mode.PNG) 35 | ## Sports 36 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/sports_light_mode.PNG) 37 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/sports_night_mode.PNG) 38 | ## Politics 39 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/polititcs_light_mode.PNG) 40 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/polititcs_night_mode.PNG) 41 | ## Breaking News 42 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/breaking_light_mode.PNG) 43 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/breaking_night_mode.PNG) 44 | ## Opinion News 45 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/opinion_light_mode.PNG) 46 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/opinion_night_mode.PNG) 47 | ## Facebook share 48 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/facebook_share.PNG) 49 | ## Whatsapp share 50 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/whatsapp_share.PNG) 51 | ## Telegram share 52 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/telegram_share.PNG) 53 | ## Copy to clipboard 54 | ![](https://github.com/sam-boghara/News-Aggregator/blob/master/screenshots/copy_to_clipboard.PNG) 55 | --------------------------------------------------------------------------------------- 56 | 57 | ## How To Use 58 | 59 | #### Software Requirements 60 | 61 | Python3 62 | 63 | #### Installation 64 | 65 | Install the dependencies by running: 66 | ```html 67 | pip install bs4 68 | pip install requests 69 | pip install django-social-share 70 | ``` 71 | 72 | #### Run using Command Prompt 73 | 74 | Navigate to the News-Aggregator folder which has manage.py file then run the following command on cmd 75 | 76 | ```html 77 | python manage.py runserver 78 | ``` 79 | 80 | ### Tech stack 81 | 82 | `Backend` : Python3,Beautiful soup
83 | `Framework` : Django
84 | `Database` : Sqlite3
85 | `Frontend` : Html,CSS,Bootstrap
86 | -------------------------------------------------------------------------------- /screenshots/Options_select.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/Options_select.PNG -------------------------------------------------------------------------------- /screenshots/breaking_light_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/breaking_light_mode.PNG -------------------------------------------------------------------------------- /screenshots/breaking_night_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/breaking_night_mode.PNG -------------------------------------------------------------------------------- /screenshots/copy_to_clipboard.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/copy_to_clipboard.PNG -------------------------------------------------------------------------------- /screenshots/entertainment_light_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/entertainment_light_mode.PNG -------------------------------------------------------------------------------- /screenshots/entertainment_night_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/entertainment_night_mode.PNG -------------------------------------------------------------------------------- /screenshots/facebook_share.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/facebook_share.PNG -------------------------------------------------------------------------------- /screenshots/latest_light_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/latest_light_mode.PNG -------------------------------------------------------------------------------- /screenshots/latest_night_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/latest_night_mode.PNG -------------------------------------------------------------------------------- /screenshots/opinion_light_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/opinion_light_mode.PNG -------------------------------------------------------------------------------- /screenshots/opinion_night_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/opinion_night_mode.PNG -------------------------------------------------------------------------------- /screenshots/polititcs_light_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/polititcs_light_mode.PNG -------------------------------------------------------------------------------- /screenshots/polititcs_night_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/polititcs_night_mode.PNG -------------------------------------------------------------------------------- /screenshots/sports_light_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/sports_light_mode.PNG -------------------------------------------------------------------------------- /screenshots/sports_night_mode.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/sports_night_mode.PNG -------------------------------------------------------------------------------- /screenshots/ss.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/ss.PNG -------------------------------------------------------------------------------- /screenshots/ss1.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/ss1.PNG -------------------------------------------------------------------------------- /screenshots/telegram_share.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/telegram_share.PNG -------------------------------------------------------------------------------- /screenshots/whatsapp_share.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sakship31/News-Aggregator/e244bed09212fac9ae3bf806e01a588c021984ec/screenshots/whatsapp_share.PNG --------------------------------------------------------------------------------