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.
MultiToeter is a python library providing a simplified unified API for sending messages to both the Twitter and Mastodon platform at the same time.
# install through pip
pip install multitoeter
MultiToeter support initializing your keys and secrets, needed for connecting to the Twitter and Mastodon API, through environment variables or through a .env
file. Below are two examples on how to use this. You can mix and match these two methods. The priority is currently to try environment variables first followed by the .env
file.
# Simple script to send a message through MultiToeter
# Save as: test.py
from multitoeter import autoinit_multitoeter
mt = autoinit_multitoeter()
toeter = mt.toeter('Testing MultiToeter API autoinit')
toeter = mt.toeter('Reply message', in_reply_to=toeter)
# environment variable example
# only use mastodon in this example
MASTODON_ACCESS_TOKEN=<..> MASTODON_BASE_URL=https://mstdn.science python test.py
# .env file example
MASTODON_ACCESS_TOKEN=<..>
MASTODON_BASE_URL=https://mstdn.science
TWITTER_CONSUMER_KEY=<..>
TWITTER_CONSUMER_SECRET=<..>
TWITTER_ACCESS_TOKEN=<..>
TWITTER_ACCESS_TOKEN_SECRET=<..>
# Now run test.py:
# python test.py
A secondary approach is to initialize MultiToeter in code instead of using the autoinit. This gives you more flexibility and allows you to use more than one account for the same platform should you need it.
from multitoeter import Mastodon, Twitter, MultiToeter
mastodon1 = Mastodon(
access_token="<..>",
api_base_url="https://mstdn.science"
)
mastodon2 = Mastodon(
access_token="<..>",
api_base_url="https://mstdn.social/"
)
twitter1 = Twitter(
consumer_key="<..>"
consumer_secret="<..>"
access_token="<..>"
access_token_secret="<..>"
)
multi = MultiToeter({'mastodon1': mastodon1, 'mastodon2': mastodon2, 'twitter': twitter1})
toeter = multi.toeter("Test post via MultiToeter API")
toeter = multi.toeter("Test reply via MultiToeter API", in_reply_to=toeter)
Limited support for media files is available. The unified API expects you to point to the media files directly.
# Assume that the file test.jpg exists
from multitoeter import autoinit_multitoeter
mt = autoinit_multitoeter()
toeter = mt.toeter('Testing MultiToeter API autoinit', media_files=['test.jpg'])
FAQs
Send out messages to Mastodon and Twitter using one simplistic unified API
We found that multitoeter 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.