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.
Social Fred API Client
Add this line to your application's Gemfile:
gem 'socialfred'
And then execute:
$ bundle
Or install it yourself as:
$ gem install socialfred
api = Socialfred::Api.new(api_key)
image1 = {data: Base64.encode64(image.download), filename: 'image.jpeg', content_type: 'image/jpeg'}
# ...
api.publications.create(
publish_at: Time.now,
text: "example text",
images: [image1, image2],
options: {
telegram: {
alternative_text: "Telegram Alternative Text",
reply_markup: {
inline_keyboard: [
[{text: 'Button', url: 'button_url'}]
]
}
}
}
)
Response:
{
'data' => {
'id' => '99',
'type' => 'publication',
'attributes' => {
'text' => 'example text',
'created_at' => '2019-10-30T23:54:12.147+01:00',
'updated_at' => '2019-10-30T23:54:12.192+01:00',
'status' => 'new',
'published_at' => '2045-06-01T12:05:00.000+01:00'
}
}
}
api.publications.update(99, text: 'another text')
Response:
{
'data' => {
'id' => '99',
'type' => 'publication',
'attributes' => {
'text' => 'another text',
'created_at' => '2019-10-30T23:54:12.147+01:00',
'updated_at' => '2019-10-31T00:01:58.128+01:00',
'status' => 'new',
'published_at' => '2045-06-01T12:05:00.000+01:00'
}
}
}
api.publications.destroy(99)
Response:
{
'data' => {
'id' => '99',
'type' => 'publication',
'attributes' => {
'text' => 'another text',
'created_at' => '2019-10-30T23:54:12.147+01:00',
'updated_at' => '2019-10-31T00:03:30.973+01:00',
'status' => 'to_be_deleted',
'published_at' => '2045-06-01T12:05:00.000+01:00'
}
}
}
api.publications.all(page: 1, per_page: 10)
Response:
{
'data' => [
{
'id' => '98',
'type' => 'publication',
'attributes' => {
'text' => 'test1',
'created_at' => '2019-10-30T20:54:14.960+01:00',
'updated_at' => '2019-10-30T20:54:15.011+01:00',
'status' => 'new',
'published_at' => '2019-10-30T20:59:14.000+01:00'
}
},
# ...
{
'id' => '95',
'type' => 'publication',
'attributes' => {
'text' => 'test2',
'created_at' => '2019-10-29T22:46:35.857+01:00',
'updated_at' => '2019-10-29T23:46:41.645+01:00',
'status' => 'published',
'published_at' => '2019-10-29T23:46:35.000+01:00'
}
}
],
'links' => {
'first' => 'https://api.socialfred.com/publications?page=1&per_page=10',
'last' => 'https://api.socialfred.com/publications?page=26&per_page=10',
'next' => 'https://api.socialfred.com/publications?page=2&per_page=10'
},
'meta' => { 'total' => 51 }
}
api.publications.find(95)
Response:
{
'data' => {
'id' => '95',
'type' => 'publication',
'attributes' => {
'text' => 'test2',
'created_at' => '2019-10-29T22:46:35.857+01:00',
'updated_at' => '2019-10-29T23:46:41.645+01:00',
'status' => 'published',
'published_at' => '2019-10-29T23:46:35.000+01:00'
}
}
}
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Bug reports and pull requests are welcome on GitHub at https://github.com/SocialFred/socialfred.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that socialfred demonstrated a not healthy version release cadence and project activity because the last version was released 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.