facebook-cli 1.3.3 → 1.3.5
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 +7 -10
- data/lib/fbcli/facebook.rb +3 -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: 1966ca73a4bbf019fb0b165265f63c85542b5804
|
4
|
+
data.tar.gz: 80c5aa0d1a796d8bd5a2d17ae3de588452235e85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34f694fd22d302314e1dfe14f9963f36e31e6fe1a952befcee49d2eb55382aff5c24f6f43eb896c3c7c88e9968b245039df5ace4688fb1edfd752604fb87f2be
|
7
|
+
data.tar.gz: 9c6939b9afb0397efb8432852d8048697cee7cb1fcf75b199990b1d237b6c97cc6909a7d042a5f5b613a1b5799248b987f2c359edfb068954cb10dba7d1e6ca8
|
data/lib/fbcli.rb
CHANGED
@@ -10,9 +10,10 @@ include GLI::App
|
|
10
10
|
|
11
11
|
program_desc "Facebook command line interface"
|
12
12
|
|
13
|
-
version '1.3.
|
13
|
+
version '1.3.5'
|
14
14
|
|
15
15
|
flag [:token], :desc => 'Provide Facebook access token', :required => false
|
16
|
+
flag [:pages, :p], :desc => 'Max pages', :required => false, :default_value => -1
|
16
17
|
|
17
18
|
def link(path)
|
18
19
|
"https://www.facebook.com/#{path}"
|
@@ -104,9 +105,10 @@ end
|
|
104
105
|
desc "Show your name and profile ID"
|
105
106
|
command :me do |c|
|
106
107
|
c.action do |global_options,options,args|
|
107
|
-
|
108
|
-
|
109
|
-
|
108
|
+
FBCLI::request_object global_options, "me" do |data|
|
109
|
+
puts "Name: #{data["name"]}"
|
110
|
+
puts "ID: #{data["id"]}"
|
111
|
+
end
|
110
112
|
end
|
111
113
|
end
|
112
114
|
|
@@ -229,14 +231,9 @@ command :event do |c|
|
|
229
231
|
|
230
232
|
puts "#{item['name']} (#{item['id']})"
|
231
233
|
|
232
|
-
if item['is_canceled']
|
233
|
-
puts "CANCELED"
|
234
|
-
puts
|
235
|
-
end
|
236
|
-
|
237
234
|
puts
|
238
235
|
puts "Location: #{item['place']['name']}" unless item['place'].nil?
|
239
|
-
puts "Date: #{date_str(item['start_time'])}"
|
236
|
+
puts "Date: #{date_str(item['start_time'])}" + (item['is_canceled'] ? " [CANCELED]" : "")
|
240
237
|
puts "Duration: #{duration / 3600} hours" if defined?(duration) and not duration.nil?
|
241
238
|
puts "Created by: #{item['owner']['name']}"
|
242
239
|
puts
|
data/lib/fbcli/facebook.rb
CHANGED
@@ -47,8 +47,9 @@ module FBCLI
|
|
47
47
|
items = request_personal_connections(global_options, cmd)
|
48
48
|
|
49
49
|
virgin = true
|
50
|
+
count = 0
|
50
51
|
|
51
|
-
while not items.nil? do
|
52
|
+
while not (items.nil? or count == global_options['pages'].to_i) do
|
52
53
|
items.each_with_index { |item, idx|
|
53
54
|
if filter.nil? or not filter.call(item)
|
54
55
|
unless separator.nil? or virgin
|
@@ -61,6 +62,7 @@ module FBCLI
|
|
61
62
|
end
|
62
63
|
}
|
63
64
|
|
65
|
+
count += 1
|
64
66
|
items = items.next_page
|
65
67
|
end
|
66
68
|
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.3.
|
4
|
+
version: 1.3.5
|
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-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A limited command line interface to the Facebook Graph API
|
14
14
|
email: specious@gmail.com
|