Skip to content

Commit 38b2c98

Browse files
committed
Added .bufferapprc.template to project
1 parent 81e5199 commit 38b2c98

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

.bufferapprc.template

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
SUPER_SECRET_AUTH_TOKEN
2+
0
3+
4+
# How to Get Started:
5+
# Create a Developer API Token here: http://bufferapp.com/developers/apps/create.
6+
# Fill in Stuff. Your answers don't matter much for the purpose of this rudimentary setup.
7+
# Submit that form and wait a short period (~2 min )
8+
# Visit: http://bufferapp.com/developers/apps
9+
# Gather Access Token and place it on line 1 of this file.
10+
# Copy this file to the root of your user's home folder:
11+
# - ~/.bufferapprc
12+
# Set Line 2 to 0 if you only have one account to post to. Otherwise it's more complicated ;). Find me on Twitter and I can explain (@_ZPH).
13+
14+
# Structure:
15+
# Line 1: Access Token
16+
# Line 2: Buffer Account number, ie posting to first account in list, use 0 (ie zero)
17+
#
18+
#TODO: convert to yaml and improve instructions
19+
# remove need for user to create their own App on bufferapp.com
20+
# Future versions will integrate with Buffer-OAuth system.
21+

bin/buff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(File.dirname(__FILE__), '..', 'lib')
44

55
require 'buff'
66

7-
_, _, access_token, profile_id = File.open(File.expand_path '~/.bufferapprc').readlines.map(&:chomp)
7+
access_token, profile_id = File.open(File.expand_path '~/.bufferapprc').readlines.map(&:chomp)
88

99
client = Buff::Client.new(access_token)
1010
id = client.profiles[profile_id.to_i].id

lib/buff/core.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
require 'pathname'
12

23
module Buff
34
begin
5+
#TODO: change from #expand_path to Pathname if appropriate
46
if File.exists?(File.expand_path("~/.bufferapprc"))
57
ACCESS_TOKEN = File.open(File.expand_path("~/.bufferapprc")).
6-
readlines[2].chomp
8+
readlines[0].chomp
79
end
810
rescue => x
911
raise x, "Bufferapprc appears to be malformed"

0 commit comments

Comments
 (0)