Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Scrape financial News from Yahoo and analyse the sentiment (PoC)
With stocknews
, you can scrape news data from the Yahoo Financial RSS Feed and store them with the sentiment of the headline and the summary.
Depending on the initialization 1 or 2 files are output as csv. No. 1 is the scraped news (optional) and no. 2 is the summary, having the summarized sentiment of news for the given date (see options) and the values.
To install the package, run pip install stocknews
In order to use stocknews
to scrape news data and prepare them for your model you simply need this:
from stocknews import StockNews
...
stocks = ['AAPL', 'MSFT', 'NFLX']
sn = StockNews(stocks, wt_key='MY_WORLD_TRADING_DATA_KEY')
df = sn.summarize()
...
This returns a pandas DataFrame and saves it to data/data.csv
by default (see options)
stocks
: A list of stocks to check. See http://eoddata.com/symbols.aspx for all symbols availablenews_file='news.csv'
: filename of the saved newssummary_file='data.csv'
: filename of the saved dataset, including sentiment and value per day and stocksave_news=True
: save the news file or scrape and analyse on the fly for recent newsclosing_hour=20
: Close of the exchange (NASDAQ in this case). News after closing will be taken for next trading day (skips the weekend as well)closing_minute=0
: Same as closing_hour
wt_key=None
: Your worldtradingdata.com API Key. Get one here. Not needed if read_rss
is called directly.pandas
https://pypi.org/project/pandas/feedparser
https://pypi.org/project/feedparser/nltk
https://pypi.org/project/nltk/requests
https://pypi.org/project/requests/numpy
https://pypi.org/project/numpy/python setup.py test
exit()
rolleyestest.py
FAQs
PoC for scraping Yahoo News with sentiment analysis
We found that stocknews 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.