Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
btc-sentiment-analysis
Advanced tools
Small Python package for gathering news articles and performing basic bitcoin sentiment analysis.
Use the package manager pip to install btc-sentiment-analysis.
pip install btc-sentiment-analysis
This python package contains python scripts for gathering news articles on the topic "Bitcoin." An XML file provided by a Google news RSS Feed, is parsed for all published news articles on "Bitcoin." The urls of the published articles are visited and scraped for all usable content such as title, article, published date, etc.
from btc_sentiment_analysis import scrape_btc_news, visualize
articles = scrape_btc_news() # returns a list of Article objects
visualize(articles) # receives list of Article objects as an argument, displays simple seaborn violin plot
The function scrape_btc_news() crawls for BTC articles on the web, scrapes important information, and creates Article objects for each news Article. Article objects contain attributes such as title, text, news source, publication date, and link. Article objects also contain two methods. The vader_analysis method uses the Natural Language Toolkit (nltk) library to return the sentiment of the title and text of the article as a dict type. The blob_analysis method uses the Text Blob (textblob) library to return the sentiment of the title and text of the article as a dict type.
class Article:
def __init__(self, title, source, date, link, text):
...
def vader_analysis(self):
...
return {'title': title_sentiment, 'text': text_sentiment}
def blob_analysis(self):
...
return {'title': title_sentiment, 'text': text_sentiment}
The function visualize simply plots an example Violin Plot using seaborn. Visualize takes any list of Article objects and returns a seaborn violin plot showing the distribution of the sentiment analysis for Article.title and Article.text using nltk's Vader, and Text Blob.
FAQs
A small sentiment analysis library for bitcoin
We found that btc-sentiment-analysis 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.