Exemplo n.º 1
0
def showUser(user_text):
    print(user_text)
    userSearch = user_text
    #getting new articles
    keyword_query = userSearch
    article_data = get_article_data(keyword_query)
    return article_data
Exemplo n.º 2
0
def show_user(user_text):
    #show the user that was input
    user_article = get_article_data(user_text)
    return ({
        'userText': user_text,
        'headlines': user_article['headlines'],
        "snippets": user_article['snippets'],
        "dates": user_article['dates'],
        "urls": user_article['urls'],
    })
Exemplo n.º 3
0
def hello_world():
    """ Returns root endpoint HTML """

    keyword_query = 'Dogecoin'  # Change it to something you're interested in!
    article_data = get_article_data(keyword_query)
    return render_template("index.html",
                           topic=keyword_query,
                           headlines=article_data['headlines'],
                           snippets=article_data['snippets'],
                           dates=article_data['dates'])
Exemplo n.º 4
0
def hello_world():
    """ Returns root endpoint HTML """

    keyword_query = 'Maluma'
    article_data = get_article_data(keyword_query)

    return render_template(
        "index.html",
        topic=keyword_query,
        headlines=article_data['headlines'],
        snippets=article_data['snippets'],
    )
Exemplo n.º 5
0
Arquivo: app.py Projeto: jhongia/lect6
def userText(user_text):
    article_data = get_article_data(user_text)
    headlines=article_data['headlines']
    return {'headlines': headlines}
Exemplo n.º 6
0
    keyword_query = 'Gamestop'  # Change it to something you're interested in!
    article_data = get_article_data(keyword_query)

    return render_template(
        "index.html",
        topic=keyword_query,
        headlines=article_data['headlines'],
        snippets=article_data['snippets'],
    )


userSearch = ""


@app.route("/search/<user_text>")
def showUser(user_text):
    print(user_text)
    userSearch = user_text
    return "Success!"


keyword_query = userSearch
article_data = get_article_data(keyword_query)
newHeadlines = article_data["headlines"]
newSnippets = article_data["snippets"]

app.run(host=os.getenv('IP', '0.0.0.0'),
        port=int(os.getenv('PORT', 8080)),
        debug=True,
        use_reloader=True)
Exemplo n.º 7
0
def userTxt(user_text):
    print(user_text)
    article_data = get_article_data(user_text)
    headlines = article_data['headlines']
    snippets = article_data['snippets']
    return {'headlines': headlines, 'snippets': snippets}