#
# brozzler/behaviors.yaml - behavior configuration
#
# Copyright (C) 2014-2016 Internet Archive
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# first matched behavior is used, so order matters here
behaviors:
 -
   url_regex: '^https?://(?:www\.)?facebook\.com/.*$'
   behavior_js_template: facebook.js.template
   # default_parameters:
   #    parameter_username: jdoe@example.com
   #    parameter_password: abcd1234
   request_idle_timeout_sec: 30
 -
   url_regex: '^https?://(?:www\.)?flickr\.com/.*$'
   behavior_js: flickr.js
   request_idle_timeout_sec: 10
 -
   url_regex: '^https?://(?:www\.)?marquette\.edu/.*$'
   behavior_js: marquette_edu.js
   request_idle_timeout_sec: 10
 -
   url_regex: '^https?://(?:www\.)?vimeo\.com/.*$'
   behavior_js: vimeo.js
   request_idle_timeout_sec: 10
 -
   url_regex: '^https?://(?:www\.)?psu24.psu.edu/.*$'
   behavior_js: psu24.js
   request_idle_timeout_sec: 10
 -
   url_regex: '^https?://(?:www\.)?instagram\.com/.*$'
   behavior_js: instagram.js
   request_idle_timeout_sec: 10
 -
   url_regex: '^https?://(?:www\.)?brooklynmuseum\.org/exhibitions/.*$'
   behavior_js_template: simpleclicks.js.template
   default_parameters:
      click_css_selector: img.img-responsive
   request_idle_timeout_sec: 10
 - # acalog https://webarchive.jira.com/browse/ARI-3775
   url_regex: '^https?://.*[?&]catoid=[^?]*$'
   behavior_js_template: simpleclicks.js.template
   default_parameters:
      click_css_selector: a[onclick]
   request_idle_timeout_sec: 10
 - # https://webarchive.jira.com/browse/ARI-3956
   url_regex: '^https?://(?:www\.)?usask.ca/.*$'
   behavior_js_template: simpleclicks.js.template
   default_parameters:
      click_css_selector: a[id='feature-next']
   request_idle_timeout_sec: 10
 - # https://webarchive.jira.com/browse/AITFIVE-451
   url_regex: '^https?://(?:www\.)?soundcloud.com/.*$'
   behavior_js_template: simpleclicks.js.template
   default_parameters:
      click_css_selector: button.sc-button-play, button.playButton
   request_idle_timeout_sec: 10
 - # https://webarchive.jira.com/browse/AITFIVE-463
   url_regex: '^https?://(?:www\.)?christophercerrone.com/.*$'
   behavior_js_template: simpleclicks.js.template
   default_parameters:
      click_css_selector: button.playButton.medium
   request_idle_timeout_sec: 10
 - # https://webarchive.jira.com/browse/ARI-4690
   url_regex: '^https?://(?:www\.)?youtube.com/.*$'
   behavior_js_template: simpleclicks.js.template
   default_parameters:
      click_css_selector: span.load-more-text
   request_idle_timeout_sec: 10
 - # https://webarchive.jira.com/browse/ARI-4725
   url_regex: '^https?://(?:www\.)?moma.org/.*$'
   behavior_js_template: simpleclicks.js.template
   default_parameters:
      click_css_selector: button[data-more-results-bottom-button]
      click_until_hard_timeout: True
   request_idle_timeout_sec: 10
 - # https://webarchive.jira.com/browse/ARI-4692
   url_regex: '^https?://(?:www\.)?fec.gov/data/.*$'
   behavior_js: fec_gov.js
   request_idle_timeout_sec: 10
 - # default fallback behavior
   url_regex: '^.*$'
   request_idle_timeout_sec: 10
   behavior_js: default.js
