facebook-cli 1.3.12 → 1.3.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fbcli.rb +17 -9
- data/lib/fbcli/auth.rb +1 -1
- data/lib/fbcli/facebook.rb +12 -0
- 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: d3859d8e0b0e3a0defe8390292b70dd40fc9f298
|
4
|
+
data.tar.gz: 3903b59c2894edd571f6e384356c4b9f1c3c7170
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3114a77b78c19c5381d64e8d5faf1538dd9a1975106f45fc8ae74ea624daa612ac59bb96ca28c1a28b6e9b57ada0cabceba8ddf4de855e7a8f835982f4326a90
|
7
|
+
data.tar.gz: 7415d2da7ef29bb80aa49b72c7b97e7ae8e3f741621d5b8fdd1f8b48b1f9c77950d425611f2caa8a54e6d63090f1866901deb37cadff5ac8e1298b493c28b129
|
data/lib/fbcli.rb
CHANGED
@@ -10,7 +10,7 @@ include GLI::App
|
|
10
10
|
|
11
11
|
program_desc "Facebook command line interface"
|
12
12
|
|
13
|
-
version '1.3.
|
13
|
+
version '1.3.16'
|
14
14
|
|
15
15
|
flag [:token], :desc => 'Provide Facebook access token', :required => false
|
16
16
|
flag [:pages, :p], :desc => 'Max pages', :required => false, :default_value => -1
|
@@ -41,7 +41,7 @@ pre do |global_options,command|
|
|
41
41
|
begin
|
42
42
|
$config = YAML.load_file(CONFIG_FILE)
|
43
43
|
rescue
|
44
|
-
exit_now!
|
44
|
+
exit_now! %(
|
45
45
|
It looks like you are running #{APP_NAME} for the first time.
|
46
46
|
|
47
47
|
The following steps are necessary to use the Facebook API:
|
@@ -49,6 +49,7 @@ pre do |global_options,command|
|
|
49
49
|
- Create a new application at: https://developers.facebook.com/apps
|
50
50
|
- In the Settings tab, set "Site URL" to "http://localhost" and
|
51
51
|
then under "App Domains" add "localhost", and click "Save"
|
52
|
+
- In the "App Review" tab, flip the switch to make your app live.
|
52
53
|
- Save the App ID and App Secret by running:
|
53
54
|
|
54
55
|
#{APP_NAME} config --appid=<app-id> --appsecret=<app-secret>
|
@@ -56,7 +57,7 @@ pre do |global_options,command|
|
|
56
57
|
After that, acquire an access token by running:
|
57
58
|
|
58
59
|
#{APP_NAME} login
|
59
|
-
|
60
|
+
)
|
60
61
|
end
|
61
62
|
end
|
62
63
|
|
@@ -107,6 +108,14 @@ command :login do |c|
|
|
107
108
|
end
|
108
109
|
end
|
109
110
|
|
111
|
+
desc "Deauthorize your access token"
|
112
|
+
command :logout do |c|
|
113
|
+
c.action do |global_options,options,args|
|
114
|
+
FBCLI::logout global_options
|
115
|
+
puts "You are now logged out."
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
110
119
|
desc "Show your name and profile ID"
|
111
120
|
command :me do |c|
|
112
121
|
c.action do |global_options,options,args|
|
@@ -139,7 +148,7 @@ command :postlink do |c|
|
|
139
148
|
c.flag [:n, :name], :desc => 'Link name'
|
140
149
|
c.flag [:d, :description], :desc => 'Link description'
|
141
150
|
c.flag [:c, :caption], :desc => 'Link caption'
|
142
|
-
c.flag [:i, :image], :desc => 'Link image'
|
151
|
+
c.flag [:i, :image], :desc => 'Link image URL'
|
143
152
|
c.action do |global_options,options,args|
|
144
153
|
link_metadata = {
|
145
154
|
"name" => options['name'],
|
@@ -166,13 +175,13 @@ command :likes do |c|
|
|
166
175
|
end
|
167
176
|
|
168
177
|
desc "List the people you are friends with (some limitations)"
|
169
|
-
long_desc
|
178
|
+
long_desc %(
|
170
179
|
As of Graph API v2.0 Facebook no longer provides access to your full friends list.
|
171
180
|
As an alternative, we now request 'taggable_friends' which only includes friends
|
172
181
|
you are allowed to tag.
|
173
182
|
|
174
183
|
See: https://developers.facebook.com/docs/apps/faq#faq_1694316010830088
|
175
|
-
|
184
|
+
)
|
176
185
|
command :friends do |c|
|
177
186
|
c.action do |global_options,options,args|
|
178
187
|
FBCLI::page_items global_options, 'taggable_friends' do |item|
|
@@ -283,7 +292,7 @@ command :event do |c|
|
|
283
292
|
FBCLI::request_object(
|
284
293
|
global_options,
|
285
294
|
id,
|
286
|
-
:fields => 'name,description,place,owner,start_time,end_time,attending_count,
|
295
|
+
:fields => 'name,description,place,owner,start_time,end_time,attending_count,declined_count,maybe_count,is_canceled'
|
287
296
|
) do |item|
|
288
297
|
starts = Time.parse(item['start_time'])
|
289
298
|
|
@@ -301,13 +310,12 @@ command :event do |c|
|
|
301
310
|
puts "Created by: #{item['owner']['name']}"
|
302
311
|
puts
|
303
312
|
puts "Attending: #{item['attending_count']}"
|
304
|
-
puts "Interested: #{item['interested_count']}"
|
305
313
|
puts "Maybe: #{item['maybe_count']}"
|
306
314
|
puts "Declined: #{item['declined_count']}"
|
307
315
|
puts
|
308
316
|
puts link "events/#{item['id']}"
|
309
317
|
|
310
|
-
if not item['description'].empty?
|
318
|
+
if not (item['description'].nil? || item['description'].empty?)
|
311
319
|
puts
|
312
320
|
puts item['description']
|
313
321
|
end
|
data/lib/fbcli/auth.rb
CHANGED
@@ -9,7 +9,7 @@ module FBCLI
|
|
9
9
|
def self.listen_for_auth_code(port, app_id, app_secret)
|
10
10
|
uri = "https://www.facebook.com/dialog/oauth?client_id=#{app_id}" +
|
11
11
|
"&redirect_uri=http://localhost:#{port}/" +
|
12
|
-
"&scope=user_likes,user_friends,user_posts,user_photos,user_videos,user_events"
|
12
|
+
"&scope=user_likes,user_friends,user_posts,user_photos,user_videos,user_events,publish_actions"
|
13
13
|
|
14
14
|
puts "Please open: #{uri}"
|
15
15
|
puts
|
data/lib/fbcli/facebook.rb
CHANGED
@@ -27,6 +27,18 @@ module FBCLI
|
|
27
27
|
str
|
28
28
|
end
|
29
29
|
|
30
|
+
def self.logout(global_options)
|
31
|
+
if @@api.nil?
|
32
|
+
@@api = init_api(global_options)
|
33
|
+
end
|
34
|
+
|
35
|
+
begin
|
36
|
+
@@api.delete_object("me/permissions")
|
37
|
+
rescue Koala::Facebook::APIError => e
|
38
|
+
exit_now! koala_error_str e
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
30
42
|
def self.request_object(global_options, id, options = {})
|
31
43
|
if @@api.nil?
|
32
44
|
@@api = init_api(global_options)
|
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.3.
|
4
|
+
version: 1.3.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ildar Sagdejev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A limited command line interface to Facebook
|
14
14
|
email: specious@gmail.com
|