Skip to content

Commit

Permalink
Added ui styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Pheyonix committed Jan 30, 2020
1 parent ded3055 commit 8443cdf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,23 @@ def index():
db.drop_all()


site = requests.get('https://thehackernews.com')
site1_content = requests.get('https://thehackernews.com')

site_data = site.text
site1_data = site1_content.text

soup = BeautifulSoup(site_data, 'html.parser')
soup1 = BeautifulSoup(site1_data, 'html.parser')


# loop through all blog posts in home page
blog_posts = soup.find("div", class_="blog-posts")
blog_posts = soup1.find("div", class_="blog-posts")

news_urls = []

story_links = soup.find_all('a', class_="story-link")
story_links1 = soup1.find_all('a', class_="story-link")


for story_link in story_links:
url = story_link.get('href')
for story_link1 in story_links1:
url = story_link1.get('href')
news_urls.append(url)

db.create_all()
Expand Down
Binary file modified news_scrape.db
Binary file not shown.
20 changes: 10 additions & 10 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css">
</head>
<body>
<h1>NewsScrape</h1>

{% for article in articles %}
<div>
<h2>{{ article.title }}</h1>
<span>{{ article.author }}</span>
<p>{{ article.summary }}</p>
<div class="container">
<h1>NewsScrape</h1>
{% for article in articles %}
<div>
<h3>{{ article.title }} | <span>{{ article.author }}</span></h3>
<p>{{ article.summary }}</p>

</div>
</div>
{% endfor %}
</div>

<!--
<ul>
{% for article in articles %}
<!-- {{ article }}-->
{{ article }}
{% for key in articles[article] %}
<!-- {{ key }} -->
<li> {{ articles[article]['title'] }} </li>
Expand All @@ -39,6 +39,6 @@ <h2>{{ article.title }}</h1>
{% endfor %}
{% endfor %}
</ul> -->
</ul> -->
</body>
</html>

0 comments on commit 8443cdf

Please sign in to comment.