Giter VIP home page Giter VIP logo

flowdock-api's Introduction

Flowdock

Ruby Gem for using the Flowdock Push API. See Push API documentation for details.

Build Status

Build Status

flowdock gem is tested on Ruby 1.9.3 and JRuby.

Dependencies

  • HTTParty
  • MultiJson

Installing

gem install flowdock

If you're using JRuby, you'll also need to install jruby-openssl gem.

Usage

To post content to Chat or Team Inbox, you need to use the target flow's API token. They can be found from tokens page.

Posting to Chat

require 'rubygems'
require 'flowdock'

# create a new Flow object with target flow's api token and external user name (enough for posting to Chat)
flow = Flowdock::Flow.new(:api_token => "__FLOW_TOKEN__", :external_user_name => "John")

# send message to Chat
flow.push_to_chat(:content => "Hello!", :tags => ["cool", "stuff"])

Posting to Team Inbox

# create a new Flow object with target flow's api token and sender information for Team Inbox posting
flow = Flowdock::Flow.new(:api_token => "__FLOW_TOKEN__",
  :source => "myapp", :from => {:name => "John Doe", :address => "[email protected]"})

# send message to Team Inbox
flow.push_to_team_inbox(:subject => "Greetings from Flowdock API Gem!",
  :content => "<h2>It works!</h2><p>Now you can start developing your awesome application for Flowdock.</p>",
  :tags => ["cool", "stuff"], :link => "http://www.flowdock.com/")

Posting to multiple flows

require 'rubygems'
require 'flowdock'

# create a new Flow object with the api tokens of the target flows
flow = Flowdock::Flow.new(:api_token => ["__FLOW_TOKEN__", "__ANOTHER_FLOW_TOKEN__"], ... )

# see above examples of posting to Chat or Team Inbox

API methods

  • Flow methods

    push_to_team_inbox - Send message to Team Inbox. See API documentation for details.

    push_to_chat - Send message to Chat. See API documentation for details.

    send_message(params) - Deprecated. Please use push_to_team_inbox instead.

Capistrano deployment task

The Flowdock API Ruby Gem includes a ready task for sending deployment notifications with Capistrano (you need to have Grit installed too). Just add the task into your deploy.rb file and configure the settings to match your project and flow:

require 'flowdock/capistrano'

# for Flowdock Gem notifications
set :flowdock_project_name, "My project"
set :flowdock_deploy_tags, ["frontend"]
set :flowdock_api_token, ["_YOUR_API_TOKEN_HERE_"]

Copyright

Copyright (c) 2012 Flowdock Ltd. See LICENSE for further details.

flowdock-api's People

Contributors

elskwid avatar lautis avatar martinsvalin avatar phlipper avatar skoschnicke avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.