facebook-cli 1.6.3.1 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4132aa240bc05d991e06305c7690a4f69dbaffa3
4
- data.tar.gz: 32d31e7bd62afd749e1bbf773a863d78ba77b078
3
+ metadata.gz: 44cd5c09bf33329300a538b684180914d8a72b9a
4
+ data.tar.gz: 3e8f8dc3019bb2dad9c27e597f3e49effe2a0000
5
5
  SHA512:
6
- metadata.gz: e397e806dd3ac6c9ab5e6b55b92d3437d5e58f37073202bc93fe14885a822bc480a8f76844732938a4c1bde3b98e4821e66427f5551a24ffe45c005b08e44297
7
- data.tar.gz: 880a6d757f064b80a7b887467edc16649791f1a364ed506b905ecc5c7d9bf8b6e42a367b4e23a5ee81f5115c7dce93c06014ba3b2b1a7f503be65eb44ece4c1c
6
+ metadata.gz: b3a0b38a973de45ab3d34960cf5fe2bc87e9cda0717e5039beb29c30008af2b129ec63d830ce10d6f2a37adfdbaea074b7462a05b4e748b75936e39475110bcb
7
+ data.tar.gz: a9c41b9fa2f8f23180e37751115767d5e4f06d7be44555f68a02df658306409ce9be8d7ad2d9cb3449b13898f2665cdd53e481ffd530006b1b1c189e1793252b
data/lib/fbcli.rb CHANGED
@@ -2,9 +2,9 @@ require 'gli'
2
2
  require 'yaml'
3
3
  require 'json'
4
4
  require 'jsonpath'
5
+ require 'fbcli/api'
5
6
  require 'fbcli/auth'
6
7
  require 'fbcli/version'
7
- require 'fbcli/facebook'
8
8
 
9
9
  APP_NAME = File.basename($0, File.extname($0))
10
10
  CONFIG_FILE = File.join(ENV['HOME'], ".#{APP_NAME}rc")
@@ -89,6 +89,7 @@ You must create and configure a Facebook application to interact with the Graph
89
89
  - Don't bother choosing a platform, instead click "Settings" under "Facebook Login" in the side bar
90
90
  - Under "Client OAuth Settings", switch "Use Strict Mode for Redirect URIs" to "No"
91
91
  - Under "Valid OAuth redirect URIs", add: "http://localhost:3333/"
92
+ (or your host identifier and port number, to receive auth code during authentication)
92
93
  - Click "Save Changes"
93
94
  - In the "App Review" tab:
94
95
  - Flip the switch to make your app live
@@ -103,6 +104,10 @@ You must create and configure a Facebook application to interact with the Graph
103
104
  Obtain an access token by running:
104
105
 
105
106
  #{APP_NAME} login
107
+
108
+ If authenticating on a remote machine or using a different port to receive the auth code:
109
+
110
+ #{APP_NAME} login --host <hostname-or-ip> --port <port>
106
111
  EOM
107
112
 
108
113
  desc "Save your Facebook API credentials"
@@ -137,12 +142,14 @@ long_desc %(
137
142
  See: https://www.oauth.com/oauth2-servers/access-tokens/
138
143
 
139
144
  Attention: if you choose to listen for the authorization token on a port number
140
- different from the default value, make sure that in your app settings the same
141
- port is specified under:
145
+ different from the default value or your host identifier is different from
146
+ "localhost", make sure that in your app settings the same host and port are
147
+ specified under:
142
148
 
143
- PRODUCTS > Facebook Login > Client OAuth Settings > Valid OAuth redirect URIs
149
+ - PRODUCTS > Facebook Login > Client OAuth Settings > Valid OAuth redirect URIs
144
150
  )
145
151
  command :login do |c|
152
+ c.flag [:host], :desc => 'This machine\'s host identifier (host name or IP address)', :default_value => 'localhost'
146
153
  c.flag [:port], :desc => 'Local TCP port to listen for authorization code', :default_value => '3333'
147
154
  c.switch [:info], :desc => 'Show information about the current access token and exit', :negatable => false
148
155
  c.action do |global_options, options|
@@ -168,7 +175,7 @@ command :login do |c|
168
175
  end
169
176
  end
170
177
  else
171
- token = FBCLI::login($config['app_id'], $config['app_secret'], options['port'])
178
+ token = FBCLI::login($config['app_id'], $config['app_secret'], options['host'], options['port'])
172
179
 
173
180
  if not token.nil?
174
181
  $config['access_token'] = token
File without changes
data/lib/fbcli/auth.rb CHANGED
@@ -6,8 +6,8 @@ require 'json'
6
6
  module FBCLI
7
7
  API_VERSION = "2.10"
8
8
 
9
- def self.login(app_id, app_secret, local_port)
10
- redirect_uri = "http://localhost:#{local_port}/"
9
+ def self.login(app_id, app_secret, local_host, local_port)
10
+ redirect_uri = "http://#{local_host}:#{local_port}/"
11
11
 
12
12
  uri = "https://www.facebook.com/dialog/oauth?client_id=#{app_id}" +
13
13
  "&redirect_uri=#{redirect_uri}" +
data/lib/fbcli/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module FBCLI
2
- VERSION = '1.6.3.1'
2
+ VERSION = '1.6.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3.1
4
+ version: 1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ildar Sagdejev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-21 00:00:00.000000000 Z
11
+ date: 2017-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: koala
@@ -75,8 +75,8 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - bin/facebook-cli
77
77
  - lib/fbcli.rb
78
+ - lib/fbcli/api.rb
78
79
  - lib/fbcli/auth.rb
79
- - lib/fbcli/facebook.rb
80
80
  - lib/fbcli/version.rb
81
81
  homepage: https://github.com/specious/facebook-cli
82
82
  licenses: