Fix: Remove default MSFT symbol to prevent silent data errors
This commit is contained in:
@@ -1279,7 +1279,10 @@ def scrape_yahoo_options(symbol, expiration=None, strike_limit=25):
|
|||||||
|
|
||||||
@app.route("/scrape_sync")
|
@app.route("/scrape_sync")
|
||||||
def scrape_sync():
|
def scrape_sync():
|
||||||
symbol = request.args.get("stock", "MSFT")
|
symbol = request.args.get("stock")
|
||||||
|
if not symbol:
|
||||||
|
return jsonify({"error": "Missing 'stock' parameter"}), 400
|
||||||
|
|
||||||
expiration = (
|
expiration = (
|
||||||
request.args.get("expiration")
|
request.args.get("expiration")
|
||||||
or request.args.get("expiry")
|
or request.args.get("expiry")
|
||||||
@@ -1297,7 +1300,10 @@ def scrape_sync():
|
|||||||
|
|
||||||
@app.route("/profile")
|
@app.route("/profile")
|
||||||
def profile():
|
def profile():
|
||||||
symbol = request.args.get("stock", "MSFT")
|
symbol = request.args.get("stock")
|
||||||
|
if not symbol:
|
||||||
|
return jsonify({"error": "Missing 'stock' parameter"}), 400
|
||||||
|
|
||||||
app.logger.info("Received /profile request for symbol=%s", symbol)
|
app.logger.info("Received /profile request for symbol=%s", symbol)
|
||||||
return jsonify(scrape_yahoo_profile(symbol))
|
return jsonify(scrape_yahoo_profile(symbol))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user