Skip to content

Commit 5391823

Browse files
committed
Added bin/buff for commandline posting of updates
1 parent c7431cb commit 5391823

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

bin/buff

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env ruby
2+
3+
$LOAD_PATH.unshift(File.dirname(__FILE__), '..', 'lib')
4+
5+
require 'buff'
6+
7+
_, _, access_token, profile_id = File.open(File.expand_path '~/.bufferapprc').readlines.map(&:chomp)
8+
9+
client = Buff::Client.new(access_token)
10+
id = client.profiles[profile_id.to_i].id
11+
12+
response = client.create_update(body: {text: ARGV.join(" "), profile_ids: [ id ] } )
13+
puts response if ENV['BUFF_DEBUG']

0 commit comments

Comments
 (0)