Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Readme tuning

  • Loading branch information...
commit 77508459c00d8b9ac562b328a80fca73ee98d081 1 parent 7ae729c
Ville Lautanala lautis authored

Showing 1 changed file with 10 additions and 21 deletions. Show diff stats Hide diff stats

  1. +10 21 README.md
31 README.md
Source Rendered
@@ -8,7 +8,7 @@ Ruby Gem for using the Flowdock Push API. See [Push API documentation](http://ww
8 8
9 9 flowdock gem is tested on Ruby 1.8.7, 1.9.3 and JRuby.
10 10
11   -## Requirements
  11 +## Dependencies
12 12
13 13 * HTTParty
14 14 * MultiJson
@@ -19,38 +19,27 @@ flowdock gem is tested on Ruby 1.8.7, 1.9.3 and JRuby.
19 19
20 20 If you're using JRuby, you'll also need to install jruby-openssl gem.
21 21
22   -## Posting to Chat
  22 +## Usage
  23 +
  24 +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](https://www.flowdock.com/account/tokens).
  25 +
  26 +### Posting to Chat
23 27
24 28 require 'rubygems'
25 29 require 'flowdock'
26 30
27 31 # create a new Flow object with target flow's api token and external user name (enough for posting to Chat)
28   - flow = Flowdock::Flow.new(:api_token => "56188e2003e370c6efa9711988f7bf02", :external_user_name => "John")
  32 + flow = Flowdock::Flow.new(:api_token => "__FLOW_TOKEN__", :external_user_name => "John")
29 33
30 34 # send message to Chat
31 35 flow.push_to_chat(:content => "Hello!", :tags => ["cool", "stuff"])
32 36
33   -## Posting to Team Inbox
  37 +### Posting to Team Inbox
34 38
35 39 # create a new Flow object with target flow's api token and sender information for Team Inbox posting
36   - flow = Flowdock::Flow.new(:api_token => "56188e2003e370c6efa9711988f7bf02",
37   - :source => "myapp", :from => {:name => "John Doe", :address => "john.doe@example.com"})
38   -
39   - # send message to Team Inbox
40   - flow.push_to_team_inbox(:subject => "Greetings from Flowdock API Gem!",
41   - :content => "<h2>It works!</h2><p>Now you can start developing your awesome application for Flowdock.</p>",
42   - :tags => ["cool", "stuff"], :link => "http://www.flowdock.com/")
43   -
44   -
45   -## Posting to both
46   -
47   - # create a new Flow object with target flow's api token, external user name and sender information
48   - flow = Flowdock::Flow.new(:api_token => "56188e2003e370c6efa9711988f7bf02", :external_user_name => "John",
  40 + flow = Flowdock::Flow.new(:api_token => "__FLOW_TOKEN__",
49 41 :source => "myapp", :from => {:name => "John Doe", :address => "john.doe@example.com"})
50 42
51   - # send message to Chat
52   - flow.push_to_chat(:content => "Hello!", :tags => ["cool", "stuff"])
53   -
54 43 # send message to Team Inbox
55 44 flow.push_to_team_inbox(:subject => "Greetings from Flowdock API Gem!",
56 45 :content => "<h2>It works!</h2><p>Now you can start developing your awesome application for Flowdock.</p>",
@@ -83,4 +72,4 @@ The Flowdock API Ruby Gem includes a ready task for sending deployment notificat
83 72
84 73 ## Copyright
85 74
86   -Copyright (c) 2011 Flowdock Ltd. See MIT-LICENSE for further details.
  75 +Copyright (c) 2012 Flowdock Ltd. See LICENSE for further details.

0 comments on commit 7750845

Please sign in to comment.
Something went wrong with that request. Please try again.