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.
Utility to share LinkedIn posts using the LinkedIn Marketing API
Made easy to use in Python.
python -m pip install linkedin-posts
The quickest way to get an Access Token is by using the LinkedIn Token generator tool
By the time I am writing this sentence, this is the most useful function of this package.
Share a post by using the function share_post
with some
arguments.
from linkedin_posts.posts import share_post
response = share_post(
"<HERE YOUR ACCESS TOKEN>",
comment="publishing a post",
author_type="organization",
author_id="71513925",
)
# Do something with your response object r (http.client.HttpResponse)
# Interesting parameters to check:
# response.getheader("x-restli-id") will return the LinkedIn Post ID
# response.code will return 201 if request proccessed correctly
...
Deleting a post is very straightforward.
Just just need the access token and pass the LinkedIn Post ID.
from linkedin_posts.posts import delete_post
response = delete_post("<HERE YOUR ACCESS TOKEN>", "urn:li:share:7104319981684674560")
# response.code will return 204 if request proccessed correctly
It is possible to share a post with a poll by using the following code:
from linkedin_posts.polls import share_poll
response = share_poll(
"<HERE YOUR ACCESS TOKEN>",
comment="Hello, this is just a test...",
poll_question="Is this is a nice poll?",
poll_options=["Yes", "No", "I do not care"],
author_type="organization",
author_id="71513925",
)
# do something with response if you need to!
Now go to your LinkedIn page and check your published poll!
To create a post with a nice picture you can use this code.
# upload a image
upload_request, image_urn = upload_image(
"<HERE YOUR ACCESS TOKEN>",
file="img/nicecv.jpg",
author_type=author_type,
author_id=author_id,
)
# create a post with the uploaded image
share_post_with_media(
"<HERE YOUR ACCESS TOKEN>",
comment="Do you like this nice cv?",
author_type=author_type,
author_id=author_id,
media_id=image_urn
)
And voilà. Here is your post!
FAQs
Utility to share Linkedin posts using the Linkedin Marketing API
We found that linkedin-posts 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.