class Object
Constants
- APP_NAME
- CONFIG_FILE
- SETUP_INSTRUCTIONS
Update instructions in README.md when these change
Public Instance Methods
date_str(date)
click to toggle source
Facebook returns dates in ISO 8601 or unix timestamp format
# File lib/fbcli.rb, line 31 def date_str(date) t = (date.is_a? Integer) ? Time.at(date) : Time.parse(date).localtime # Convert to human friendly representation in user's time zone (almost RFC 2822) t.strftime('%a, %-d %b %Y %H:%M:%S %Z') end
link(path)
click to toggle source
# File lib/fbcli.rb, line 21 def link(path) "https://www.facebook.com/#{path}" end
link_to_post(full_post_id)
click to toggle source
# File lib/fbcli.rb, line 25 def link_to_post(full_post_id) profile_id, post_id = full_post_id.split '_', 2 link "#{profile_id}/posts/#{post_id}" end
save_config()
click to toggle source
# File lib/fbcli.rb, line 38 def save_config File.open(CONFIG_FILE, 'w') do |f| f.write $config.to_yaml end end