Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

freefeed-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

freefeed-client

  • 1.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

freefeed-client

Ruby wrapper for Freefeed API.

Gem Version

Installation

Add following line to your Gemfile:

gem 'freefeed-client'

And then execute:

$ bundle

Or install it system-wide:

$ gem install freefeed-client

Usage

First things first, you need to obtain a token for your user. Then create your api client like this:

require 'freefeed'

client = Freefeed::Client.new('yourFreefeedAPIToken')

post = Freefeed::Types::PostCreate.new(
  {
    post: { 
      body: 'Hello World!'
    },
    meta: {
      feeds: ['yourusername']
    }
  }
)

Freefeed::Post.create(client, post)

You can achive the same result without addressing Freefeed::Post class directly:

require 'freefeed'

client = Freefeed::Client.new('yourFreefeedAPIToken')

post = Freefeed::Types::PostCreate.new(
  {
    post: { 
      body: 'Hello World!'
    },
    meta: {
      feeds: ['yourusername']
    }
  }
)

client.posts_create(post)

You can even skip instantiating PostCreate type, but you will lose some validation:

require 'freefeed'

client = Freefeed::Client.new('yourFreefeedAPIToken')

client.posts_create({post: {body: 'Hello World!'}, meta: {feeds: ['yourusername']}})

Logging

By default, freefeed-client logs everything to STDOUT. You can change this behavior and provide your own logger class with some options. See example below:

client = Freefeed::Client.new(
  'yourFreefeedAPIToken',
  logger: Logger.new('log.txt'),
  logger_options: {bodies: false, headers: false}
)

FAQs

Package last updated on 14 Oct 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc