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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fbcli.rb +30 -9
  3. data/lib/fbcli/auth.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 222cdb626bb8d7571fefb3d44563150c1efd4307
4
- data.tar.gz: 947dbe9be1dde3c13457e63da53e437c76c03d97
3
+ metadata.gz: ffc1817a8e17e02b98a671538b6c6363baa6c5c8
4
+ data.tar.gz: 18e71a389f418d64a5c4f766d1e29c428adc4ad4
5
5
  SHA512:
6
- metadata.gz: e7a77fbf6c34a09e2fbb3d7178505c8656d646dde49f13e2dae7faf5476ae883f59c505487e6fd7cffb8c9d5b010ede1534e5eecfeb5132120c806e41dfd0a50
7
- data.tar.gz: 322e1f11ef30a0b856280a71b34b8e24d019c97c11e6ddee6e9de618dde65691b95eedf12a0f0e74aaa49b86740f0584fcd4da20fe88fb15dee39539c5a2408c
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.7'
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, add "localhost" to the App Domains
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 'invitable_friends' which only includes friends
142
- you are allowed to invite to use your app.
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, 'invitable_friends' do |item|
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
- consumePhoto = Proc.new do |item|
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", '- - -', &consumePhoto
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", '- - -', &consumePhoto
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,user_posts,user_events"
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.7
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-27 00:00:00.000000000 Z
11
+ date: 2016-09-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A limited command line interface to the Facebook Graph API
13
+ description: A limited command line interface to Facebook
14
14
  email: specious@gmail.com
15
15
  executables:
16
16
  - facebook-cli