Sha256: 0629bd6d1f3f3cd5afc0bf831d0c78793a4ff7be9a427ea0dd29a7119e713868

Contents?: true

Size: 964 Bytes

Versions: 2

Compression:

Stored size: 964 Bytes

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'mail'

require_relative '../src/facebook_connection'
require_relative '../src/config'
require_relative '../src/initializers/mail_initializer'
require_relative '../src/senders'
require_relative '../src/args_parser'
require_relative '../src/message_sender'
require_relative '../src/error_reporter'

options = ArgsParser.parse_args

begin
  raise 'Error triggered by --simulate-error flag' if options[:simulate_error]

  facebook_connection = FacebookConnection.new(headless: options[:headless])
  facebook_connection.cookie_handler.clear! if options[:clear_cookies]
  facebook_connection.login if options[:login]
  message_sender = MessageSender.new(options[:sender], facebook_connection)
  message_sender.send_unread_messages if options[:unread_messages]
  message_sender.send_messages if options[:messages]
  facebook_connection.close
rescue StandardError => e
  ErrorReporter.report_error(options[:sender], e)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fuck_facebook-0.4.1 bin/fuck-facebook
fuck_facebook-0.4.0 bin/fuck-facebook