#!/usr/bin/env ruby
# frozen_string_literal: true

$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'app'))

require 'indicina'

locations = [
  'us-east-1',
  'us-west-1',
  'eu-central-1',
  'eu-west-2',
  'eu-west-3',
  'ap-northeast-1',
  'ap-northeast-2',
  'sa-east-1'
]

urls = [
  'https://www.twitch.tv/monstercat', # Channel Page
  'https://gaming.youtube.com/watch?v=jdYJgpT3oGQ',
  'https://mixer.com/monstercat',
  'https://www.twitch.tv', # Front Page
  'https://gaming.youtube.com/',
  'https://mixer.com/',
  'https://www.twitch.tv/videos/221250127', # Vod Watch
  'https://www.youtube.com/watch?time_continue=129&v=fWfsevw4u_k',
  'https://mixer.com/NVAD3?vod=16958068',
  'https://www.twitch.tv/directory', # All Games
  'https://gaming.youtube.com/games',
  'https://gaming.youtube.com/live',
  'https://mixer.com/browse/all',
  'https://www.twitch.tv/directory/game/Fortnite', # Single Game
  'https://gaming.youtube.com/game/UCONmUmaDEnG94vzGwtMxdKQ#tab=2',
  'https://mixer.com/browse/all?type=267073-PLAYERUNKNOWN%27S%20BATTLEGROUNDS',
  'https://www.twitch.tv/signup', # Signup
  'https://accounts.google.com/SignUpWithoutGmail?service=youtube&continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26next%3Dhttps%253A%252F%252Fgaming.youtube.com%252F%253Fpli%253D1%26feature%3D__FEATURE__%26app%3Ddesktop%26hl%3Den&hl=en',
  'https://signup.live.com/signup?lw=1&fl=easi2&cobrandid=90011&prompt=select_account&client_id=00000000401B4D20&response_type=code&contextid=7D5F13A87664290A&bk=1516678335&ru=https%3a%2f%2flogin.live.com%2foauth20_authorize.srf%3flw%3d1%26fl%3deasi2%26cobrandid%3d90011%26prompt%3dselect_account%26client_id%3d00000000401B4D20%26response_type%3dcode%26redirect_uri%3dhttps%253A%252F%252Fmixer.com%252Fapi%252Fv1%252Foauth%252Fmsa%252Fcheck%26state%3d7yc_etu_eN4Uv-K-JHAk6M%26scope%3dXboxlive.signin%26contextid%3d7D5F13A87664290A%26mkt%3dEN-US%26lc%3d1033%26bk%3d1516678335&uiflavor=web&uaid=0970cd2ef34a4679891a15d642969de4&mkt=EN-US&lc=1033&lic=1',
  'https://www.twitch.tv/twitchutoober/dashboard', # Live Dashboard
  'https://www.youtube.com/live_dashboard',
  'https://www.twitch.tv/settings/profile', # Settings
  'https://www.youtube.com/account'
]

Object.new.instance_eval do
  sass :indicina, self, 'indicina.css'
end

Object.new.instance_eval do
  @indexes_by_urls = urls.map { |url| [url, locations.map { |loc| RunsIndex.new loc, url }] }
  slim :index, self, 'index.html'
end
