def index(): business_news = get_news('business') #sasa=get_news() # title = 'THE NEWS APP' return render_template('index.html', business = business_news)
def index(): ''' It returns the index page and its content ''' news = get_news('business') sports_news = get_news('sports') technology_news = get_news('technology') entertainment_news = get_news('entertainment') title = "News Highlighter" return render_template('index.html', news=news, sports_news=sports_news, technology_news=technology_news, entertainment_news=entertainment_news)
def index(): ''' A function that returns the index page and the contents it has ''' #Getting news highlights news_highlights = get_news() return render_template('index.html', highlights=news_highlights)
def news(country): ''' View root page function that returns the country page and its data ''' # Getting news business = get_news(country,'business') technology = get_news(country, 'technology') science = get_news(country, 'science') general = get_news(country, 'general') health = get_news(country, 'health') entertainment = get_news(country, 'entertainment') title = 'Home - Welcome to The best News Website Online' return render_template('news.html',country=country,title = title,business = business,technology= technology,science=science,general=general,health=health,entertainment=entertainment)
def index(): sports = get_news('sports', 2) entertainment = get_news('entertainment', 2) health = get_news('health', 2) tech = get_news('technology', 2) business = get_news('business', 2) science = get_news('science', 2) general = get_news('general', 7) title = 'HOME - Centre of United Kingdom News' return render_template('index.html', title=title, sports=sports, entertainment=entertainment, health=health, tech=tech, science=science, business=business, gen=general)
def tech(): technology = get_news('technology', 20) return render_template('tech.html', tech=technology)
def sports(): sport = get_news('sports', 20) return render_template('sport.html', sport=sport)
def science(): scienze = get_news('science', 20) return render_template('science.html', science=scienze)
def health(): healthy = get_news('health', 20) return render_template('health.html', healthy=healthy)
def biz(): biz = get_news('business', 20) return render_template('biz.html', biz=biz)
def ent(): ent = get_news('entertainment', 20) return render_template('ent.html', ent=ent)
def index(): news_results = get_news('popular') print(news_results) return render_template('index.html', popular=news_results, top_headlines=news_results)