Class: InstagramCrawler::Main

Inherits:
Object
  • Object
show all
Defined in:
lib/instagram_crawler/main.rb

Class Method Summary collapse

Class Method Details

.runObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/instagram_crawler/main.rb', line 3

def self.run
  Logger.info text_to_ASCII.light_red
  Logger.info "Running instagram-crawler v#{InstagramCrawler::VERSION}\n"
  start_time = Time.now
  File.mkdir
  page_info, user_id = Parser::Html.new(Config.base_url).parsing
  Parser::Json.new(page_info, user_id).parsing if page_info["has_next_page"]
  end_time = Time.now
  Logger.info "\nSuccess, all files have been downloaded!".light_green
end