Example #1
0
def index():
    business_news = get_news('business')
    

   #sasa=get_news()
   # title = 'THE NEWS APP'
    return render_template('index.html', business = business_news)
Example #2
0
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)
Example #3
0
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)
Example #4
0
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)
Example #5
0
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)
Example #6
0
def tech():
    technology = get_news('technology', 20)

    return render_template('tech.html', tech=technology)
Example #7
0
def sports():
    sport = get_news('sports', 20)

    return render_template('sport.html', sport=sport)
Example #8
0
def science():
    scienze = get_news('science', 20)

    return render_template('science.html', science=scienze)
Example #9
0
def health():
    healthy = get_news('health', 20)

    return render_template('health.html', healthy=healthy)
Example #10
0
def biz():
    biz = get_news('business', 20)

    return render_template('biz.html', biz=biz)
Example #11
0
def ent():
    ent = get_news('entertainment', 20)

    return render_template('ent.html', ent=ent)
Example #12
0
def index():
    news_results = get_news('popular')
    print(news_results)
    return render_template('index.html',
                           popular=news_results,
                           top_headlines=news_results)