Sha256: 896233686ec9f4383f44040ad8d01569c4d4dbd488ac3e01ff0ed8ec559afa8f

Contents?: true

Size: 576 Bytes

Versions: 1

Compression:

Stored size: 576 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w(.. lib))
require 'fanswatch'

puts ENV['FB_CLIENT_ID']

page_id = ARGV[0] || ENV['FB_PAGE_ID']
unless page_id
  puts 'USAGE: fanswatch [page_id]'
  exit(1)
end

page = FansWatch::Page.find(id: page_id)

puts page.name
puts Array.new(page.name.length) { '-' }.join
page.feed.postings.first(3).each.with_index do |post, index|
  print "#{index + 1}: "
  puts post.message ? post.message : '(blank)'
  puts "Attached: #{post.attachment.url}" if post.attachment
  puts
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fanswatch-0.1.0 bin/fanswatch