facebook-cli 1.3.3 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fbcli.rb +7 -10
  3. data/lib/fbcli/facebook.rb +3 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 680c68383186dc7064cdfe6947e825a4d91803ec
4
- data.tar.gz: 121ab05a54b57245edd58cae227ef84ecdee9a4e
3
+ metadata.gz: 1966ca73a4bbf019fb0b165265f63c85542b5804
4
+ data.tar.gz: 80c5aa0d1a796d8bd5a2d17ae3de588452235e85
5
5
  SHA512:
6
- metadata.gz: d9d9855b3a79ae2bb72f2476536a038b16bfdd26c959c08c8c7e28e25ba070491673ceb1c78123fdb74e23980fd039c32072d1be16e447a626c393e5611927ba
7
- data.tar.gz: f3929fde6a2f3889d1ff5c5ce10cdd4de975a319ef9eac75faeac8af65730a8d49f94825a29482a95431e9ee2f1b5d1d06815e35eb288e1bce5c7b893bf30248
6
+ metadata.gz: 34f694fd22d302314e1dfe14f9963f36e31e6fe1a952befcee49d2eb55382aff5c24f6f43eb896c3c7c88e9968b245039df5ace4688fb1edfd752604fb87f2be
7
+ data.tar.gz: 9c6939b9afb0397efb8432852d8048697cee7cb1fcf75b199990b1d237b6c97cc6909a7d042a5f5b613a1b5799248b987f2c359edfb068954cb10dba7d1e6ca8
@@ -10,9 +10,10 @@ include GLI::App
10
10
 
11
11
  program_desc "Facebook command line interface"
12
12
 
13
- version '1.3.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
- data = FBCLI::request_data global_options, ""
108
- puts "Name: #{data["name"]}"
109
- puts "Your profile ID: #{data["id"]}"
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
@@ -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.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-24 00:00:00.000000000 Z
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