Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
A Python libary to interact with the MarketWatch Stock Market Game Based on code from
pip install marketwatch
pip install git+https://github.com/antoinebou12/marketwatch.git
git clone https://github.com/antoinebou12/marketwatch.git
Here are some examples of how you can use the MarketWatch class:
First, import the MarketWatch class from the script:
from marketwatch import MarketWatch
Then, create an instance of the MarketWatch class using your MarketWatch username and password:
marketwatch = MarketWatch(username, password)
To get the current price of a stock:
marketwatch.get_price("AAPL")
https://www.marketwatch.com/games
To get information about games on the site:
marketwatch.get_games()
marketwatch.get_game("game-name")
marketwatch.get_game_settings("game-name")
marketwatch.get_leaderboard("game-name")
marketwatch.get_portfolio("game-name")
marketwatch.get_positions("game-name")
marketwatch.get_pending_orders("game-name")
marketwatch.buy(game_id, "AAPL", 100)
marketwatch.sell("game-name", "AAPL", 100)
https://www.marketwatch.com/watchlist
To create a watchlist:
marketwatch.create_watchlist('My Watchlist')
To add stocks to a watchlist:
marketwatch.add_to_watchlist(watchlist_id, ['AAPL', 'GOOG'])
To get all watchlists:
watchlists = marketwatch.get_watchlists()
To delete a watchlist:
marketwatch.delete_watchlist(watchlist_id)
import os
username = os.environ.get("MARKETWATCH_USERNAME")
password = os.environ.get("MARKETWATCH_PASSWORD")
marketwatch = MarketWatch(username, password)
print(f"Price: {marketwatch.get_price('AAPL')} \n")
print(f"Games: {marketwatch.get_games()} \n")
games1 = marketwatch.get_games()[0]["name"].lower().replace(" ", "-")
print(f"Game: {marketwatch.get_game(games1)} \n")
print(f"Game Settings: {marketwatch.get_game_settings(games1)} \n")
print(f"Leaderboard: {marketwatch.get_leaderboard(games1)} \n")
print(f"Porfolio: {marketwatch.get_portfolio(games1)} \n")
print(f"Position: {marketwatch.get_positions(games1)}")
print(f"Orders Pending: {marketwatch.get_pending_orders(games1)}")
marketwatch.buy(games1, "AAPL", 100)
print(f"Position diff: {marketwatch.get_positions(games1)}")
Contributions are welcome. Please open an issue or submit a pull request.
This project is licensed under the MIT License.
FAQs
MarketWatch's API
We found that marketwatch demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.