buff 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.bufferapprc.template +9 -7
- data/README.md +15 -20
- data/bin/buff +13 -3
- data/lib/buff/core.rb +6 -6
- data/lib/buff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55d07c19c91104e3a715a9a1e59e6c34e66aff7d
|
4
|
+
data.tar.gz: 754e031a6135e86e9be58da6f061995a39f6ff6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e2bbc9ae2794b4d54afebb526d16f10e1607019ee99e51c09fdb355af5731824939bd0f1349737893d8dd372bfb312daf30294037f2cc8901e1402c017ca15d
|
7
|
+
data.tar.gz: 4ebb1ec871e0fb8da7fc8ecb0ffb5d54fbe6ba4402c652d53a73257b7861bde371d84fe1b18b88a9f9d5c37e4aea1120fb0c594fdbc2d616eec09cb0dda8d2f5
|
data/.bufferapprc.template
CHANGED
@@ -1,21 +1,23 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
---
|
2
|
+
access_token: ASDFASDFASDF
|
3
|
+
profile_index: 0
|
4
|
+
version: 0.0.1
|
3
5
|
|
4
6
|
# How to Get Started:
|
5
7
|
# Create a Developer API Token here: http://bufferapp.com/developers/apps/create.
|
6
8
|
# Fill in Stuff. Your answers don't matter much for the purpose of this rudimentary setup.
|
7
9
|
# Submit that form and wait a short period (~2 min )
|
8
10
|
# Visit: http://bufferapp.com/developers/apps
|
9
|
-
# Gather Access Token and place it
|
11
|
+
# Gather Access Token and place it after the word "access_token"
|
10
12
|
# Copy this file to the root of your user's home folder:
|
13
|
+
# Set "profile_index" 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).
|
11
14
|
# - ~/.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
15
|
|
14
16
|
# Structure:
|
15
|
-
#
|
16
|
-
#
|
17
|
+
# access_token: Access Token
|
18
|
+
# profile_index: Buffer Account number, ie posting to first account in list, use 0 (ie zero)
|
17
19
|
#
|
18
|
-
#TODO:
|
20
|
+
#TODO: improve instructions
|
19
21
|
# remove need for user to create their own App on bufferapp.com
|
20
22
|
# Future versions will integrate with Buffer-OAuth system.
|
21
23
|
|
data/README.md
CHANGED
@@ -37,34 +37,29 @@ Or install RubyGems version, which will receive more attention to stability:
|
|
37
37
|
|
38
38
|
|
39
39
|
```
|
40
|
-
|
41
|
-
|
40
|
+
---
|
41
|
+
ACCESS_TOKEN: (BufferApp OAuth Access Token)
|
42
|
+
PROFILE_INDEX: (default of 0)
|
43
|
+
VERSION: (Do not alter)
|
42
44
|
|
43
|
-
# Structure:
|
44
|
-
# Access Token: line 1
|
45
|
-
# Profile number, counting from zero
|
46
45
|
```
|
47
46
|
|
48
47
|
## Access Token Instructions
|
49
48
|
|
50
|
-
How to Get Started:
|
49
|
+
# How to Get Started:
|
51
50
|
====
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
- ~/.bufferapprc
|
51
|
+
# Create a Developer API Token here: http://bufferapp.com/developers/apps/create.
|
52
|
+
# Fill in Stuff. Your answers don't matter much for the purpose of this rudimentary setup.
|
53
|
+
# Submit that form and wait a short period (~2 min )
|
54
|
+
# Visit: http://bufferapp.com/developers/apps
|
55
|
+
# Gather Access Token and place it after the word "access_token"
|
56
|
+
# Copy this file to the root of your user's home folder:
|
59
57
|
* 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](https://twitter.com/_ZPH).
|
58
|
+
# - ~/.bufferapprc
|
60
59
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
TODO: convert to yaml and improve instructions
|
66
|
-
remove need for user to create their own App on bufferapp.com
|
67
|
-
Future versions will integrate with Buffer-OAuth system.
|
60
|
+
#TODO: improve instructions
|
61
|
+
# remove need for user to create their own App on bufferapp.com
|
62
|
+
# Future versions will integrate with Buffer-OAuth system.
|
68
63
|
|
69
64
|
## API Coverage
|
70
65
|
|
data/bin/buff
CHANGED
@@ -4,10 +4,20 @@ $LOAD_PATH.unshift(File.dirname(__FILE__), '..', 'lib')
|
|
4
4
|
|
5
5
|
require 'buff'
|
6
6
|
|
7
|
-
|
7
|
+
begin
|
8
|
+
require 'yaml'
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
options = YAML.load_file(File.expand_path('~/.bufferapprc'))
|
11
|
+
if options.class == String
|
12
|
+
options['access_token'], options['profile_index'] = options.split
|
13
|
+
options['verion'] = '0.0.0'
|
14
|
+
end
|
15
|
+
rescue
|
16
|
+
puts "Please upgrade from older config file structure" if ENV['BUFF_DEBUG']
|
17
|
+
end
|
18
|
+
|
19
|
+
client = Buff::Client.new(options['access_token'])
|
20
|
+
id = client.profiles[options['profile_index'].to_i].id
|
11
21
|
|
12
22
|
response = client.create_update(body: {text: ARGV.join(" "), profile_ids: [ id ] } )
|
13
23
|
puts response if ENV['BUFF_DEBUG']
|
data/lib/buff/core.rb
CHANGED
@@ -3,12 +3,12 @@ require 'pathname'
|
|
3
3
|
module Buff
|
4
4
|
begin
|
5
5
|
#TODO: change from #expand_path to Pathname if appropriate
|
6
|
-
if File.exists?(File.expand_path("~/.bufferapprc"))
|
7
|
-
|
8
|
-
|
9
|
-
end
|
10
|
-
rescue => x
|
11
|
-
raise x, "Bufferapprc appears to be malformed"
|
6
|
+
# if File.exists?(File.expand_path("~/.bufferapprc"))
|
7
|
+
# ACCESS_TOKEN = File.open(File.expand_path("~/.bufferapprc")).
|
8
|
+
# readlines[0].chomp
|
9
|
+
# end
|
10
|
+
# rescue => x
|
11
|
+
# raise x, "Bufferapprc appears to be malformed"
|
12
12
|
end
|
13
13
|
|
14
14
|
class Client
|
data/lib/buff/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ZPH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|