facebook-cli 1.3.7 → 1.3.10
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/lib/fbcli.rb +30 -9
- data/lib/fbcli/auth.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffc1817a8e17e02b98a671538b6c6363baa6c5c8
|
4
|
+
data.tar.gz: 18e71a389f418d64a5c4f766d1e29c428adc4ad4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2cc32f474b9199bdc15f6757b6e2b7020df41e5e53fc46b63cf864ba3c04983e03be588f069343a8f0366672b4e74cf8516071f30510bca156098ee9398f1e7
|
7
|
+
data.tar.gz: 27f266d8b9b811d2cef265cdc896edc867272039e7c639818cf6aa4c47a4a1705f1a9e803ae5a6f2e05e425b5d3407e72a2c127cc2178ead81bff62df1cc8556
|
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.10'
|
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
|
@@ -47,7 +47,8 @@ pre do |global_options,command|
|
|
47
47
|
The following steps are necessary to use the Facebook API:
|
48
48
|
|
49
49
|
- Create a new application at: https://developers.facebook.com/apps
|
50
|
-
- In the Settings tab,
|
50
|
+
- In the Settings tab, set "Site URL" to "http://localhost" and
|
51
|
+
then under "App Domains" add "localhost", and click "Save"
|
51
52
|
- Save the App ID and App Secret by running:
|
52
53
|
|
53
54
|
#{APP_NAME} config --appid=<app-id> --appsecret=<app-secret>
|
@@ -138,14 +139,14 @@ end
|
|
138
139
|
desc "List the people you are friends with (some limitations)"
|
139
140
|
long_desc <<~EOM
|
140
141
|
As of Graph API v2.0 Facebook no longer provides access to your full friends list.
|
141
|
-
As an alternative, we now request '
|
142
|
-
you are allowed to
|
142
|
+
As an alternative, we now request 'taggable_friends' which only includes friends
|
143
|
+
you are allowed to tag.
|
143
144
|
|
144
145
|
See: https://developers.facebook.com/docs/apps/faq#faq_1694316010830088
|
145
146
|
EOM
|
146
147
|
command :friends do |c|
|
147
148
|
c.action do |global_options,options,args|
|
148
|
-
FBCLI::page_items global_options, '
|
149
|
+
FBCLI::page_items global_options, 'taggable_friends' do |item|
|
149
150
|
puts item['name']
|
150
151
|
end
|
151
152
|
end
|
@@ -164,8 +165,8 @@ command :feed do |c|
|
|
164
165
|
end
|
165
166
|
end
|
166
167
|
|
167
|
-
|
168
|
-
puts item["name"] unless not item.key?("name")
|
168
|
+
handlePhoto = Proc.new do |item|
|
169
|
+
puts "#{item["name"]}\n\n" unless not item.key?("name")
|
169
170
|
puts link "#{item["id"]}"
|
170
171
|
puts "Created: #{date_str(item["created_time"])}"
|
171
172
|
end
|
@@ -173,14 +174,34 @@ end
|
|
173
174
|
desc "List photos you have uploaded"
|
174
175
|
command :photos do |c|
|
175
176
|
c.action do |global_options,options,args|
|
176
|
-
FBCLI::page_items global_options, "photos?type=uploaded", '- - -', &
|
177
|
+
FBCLI::page_items global_options, "photos?type=uploaded", '- - -', &handlePhoto
|
177
178
|
end
|
178
179
|
end
|
179
180
|
|
180
181
|
desc "List photos you are tagged in"
|
181
182
|
command :photosof do |c|
|
182
183
|
c.action do |global_options,options,args|
|
183
|
-
FBCLI::page_items global_options, "photos", '- - -', &
|
184
|
+
FBCLI::page_items global_options, "photos", '- - -', &handlePhoto
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
handleVideo = Proc.new do |item|
|
189
|
+
puts "#{item["description"]}\n\n" unless not item.key?("description")
|
190
|
+
puts link "#{item["id"]}"
|
191
|
+
puts "Updated: #{date_str(item["updated_time"])}"
|
192
|
+
end
|
193
|
+
|
194
|
+
desc "List videos you have uploaded"
|
195
|
+
command :videos do |c|
|
196
|
+
c.action do |global_options,options,args|
|
197
|
+
FBCLI::page_items global_options, "videos?type=uploaded", '- - -', &handleVideo
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
desc "List videos you are tagged in"
|
202
|
+
command :videosof do |c|
|
203
|
+
c.action do |global_options,options,args|
|
204
|
+
FBCLI::page_items global_options, "videos", '- - -', &handleVideo
|
184
205
|
end
|
185
206
|
end
|
186
207
|
|
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_photos,
|
12
|
+
"&scope=user_likes,user_friends,user_posts,user_photos,user_videos,user_events"
|
13
13
|
|
14
14
|
puts "Please open: #{uri}"
|
15
15
|
puts
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
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.10
|
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-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: A limited command line interface to
|
13
|
+
description: A limited command line interface to Facebook
|
14
14
|
email: specious@gmail.com
|
15
15
|
executables:
|
16
16
|
- facebook-cli
|