示例#1
0
def get_stock(stockName):
    # stock=request.args.get(stockName)
    # req = requests.get('http://127.0.0.1:7090/portfolio/tickers')
    # symbols = json.loads(req.content)["tickers"]

    ticker = Ticker(stockName)
    data = ticker.summary_detail
    news = ticker.news(5)
    return jsonify(data,news)
示例#2
0
def get_multiple_stock():
    # stock=request.args.get('symbol',default="GOOG")
    """
    Input example: {"Stocks":["GOOG","MSFT"]}
    news input int -> needs to be changed
    """
    data = request.get_json()
    ticker = Ticker(data["stocks"])
    data = ticker.summary_detail
    news = ticker.news(5)
    return jsonify(data,news)