<commit_before>from flask import Flask
from flask import jsonify
from bs4 import BeautifulSoup
from newspaper import Article

import requests


# HN=newspaper.build('https://news.ycombinator.com/')

app = Flask(__name__)

@app.route("/api/fresh")
def news():
	freshNews = []

	r  = requests.get("https://news.ycombinator.com/")
	data = r.text
	soup = BeautifulSoup(data)

	for link in soup.find_all('a'):
		if len(freshNews) == 20:
			return jsonify(freshNews)
		try:
			if "storylink" in link.get("class"):
				# print(link.get("class"))
				article = Article(link.get("href"))
				article.download()
				article.parse()
				freshNews.append({
					"title": article.title,
					"text": article.text
					})
	

		except Exception as e:
			4+4

	
	
    <commit_msg>ready for deployment<commit_after>from flask import Flask
from flask import jsonify
from bs4 import BeautifulSoup
from newspaper import Article

import requests


# HN=newspaper.build('https://news.ycombinator.com/')

app = Flask(__name__)

@app.route("/api/fresh")
def news():
	freshNews = []

	r  = requests.get("https://news.ycombinator.com/")
	data = r.text
	soup = BeautifulSoup(data)

	for link in soup.find_all('a'):
		if len(freshNews) == 20:
			return jsonify(freshNews)
		try:
			if "storylink" in link.get("class"):
				# print(link.get("class"))
				article = Article(link.get("href"))
				article.download()
				article.parse()
				freshNews.append({
					"title": article.title,
					"content": article.text
					})
	

		except Exception as e:
			4+4




if __name__ == '__main__':
    app.run()
{'fraction_non_alphanumeric': 0.1449459631277813, 'fraction_numerical': 0.006357279084551812, 'mean_word_length': 3.510028653295129, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1278758', 'n_tokens_mistral': 643, 'n_tokens_neox': 529, 'n_words': 126}