From e2dbf68ccd544e53792e38cbb5d71af65d1beb81 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Tue, 20 Dec 2016 16:38:11 -0800 Subject: [PATCH] remove obsolete facebook login code --- brozzler/behaviors.yaml | 5 +---- .../{facebook.js.j2 => facebook.js} | 20 +------------------ setup.py | 2 +- 3 files changed, 3 insertions(+), 24 deletions(-) rename brozzler/js-templates/{facebook.js.j2 => facebook.js} (89%) diff --git a/brozzler/behaviors.yaml b/brozzler/behaviors.yaml index 8a7dab2..34c6334 100644 --- a/brozzler/behaviors.yaml +++ b/brozzler/behaviors.yaml @@ -19,10 +19,7 @@ # first matched behavior is used, so order matters here - url_regex: '^https?://(?:www\.)?facebook\.com/.*$' - behavior_js_template: facebook.js.j2 - # default_parameters: - # parameter_username: jdoe@example.com - # parameter_password: abcd1234 + behavior_js_template: facebook.js request_idle_timeout_sec: 30 - url_regex: '^https?://(?:www\.)?marquette\.edu/.*$' diff --git a/brozzler/js-templates/facebook.js.j2 b/brozzler/js-templates/facebook.js similarity index 89% rename from brozzler/js-templates/facebook.js.j2 rename to brozzler/js-templates/facebook.js index d93e127..c5c1770 100644 --- a/brozzler/js-templates/facebook.js.j2 +++ b/brozzler/js-templates/facebook.js @@ -39,8 +39,6 @@ var UMBRA_THINGS_TO_CLICK_SELECTOR = 'a[href^="/browse/likes"], *[rel="theater"] //div[class="phm pluginLikeboxStream"] = facebook widget embedded in 3rd party pages var UMBRA_THINGS_TO_SCROLL_SELECTOR = 'div[class="phm pluginLikeboxStream"]'; var NUMBER_FAILED_SCROLL_ATTEMPTS_ON_THING_TO_SCROLL_BEFORE_STOP_SCROLLING = 5; -var UMBRA_FB_USER_NAME = "${parameter_username}"; -var UMBRA_FB_PASSWORD = "${parameter_password}"; var umbraAlreadyClicked = {}; var umbraAlreadyScrolledThing = {}; var umbraScrolledThingFailedScrollAttempts = {}; @@ -172,15 +170,6 @@ var umbraIntervalFunc = function() { } } -var umbraFacebookLogin = function() { - var emailInput = document.querySelector("form#login_form input#email"); - var passwordInput = document.querySelector("form#login_form input#pass"); - var loginButton = document.querySelector("form#login_form label#loginbutton > input"); - emailInput.value=UMBRA_FB_USER_NAME; - passwordInput.value=UMBRA_FB_PASSWORD; - loginButton.click(); -} - // If we haven't had anything to do (scrolled, clicked, etc) in this amount of // time, then we consider ourselves finished with the page. var UMBRA_USER_ACTION_IDLE_TIMEOUT_SEC = 10; @@ -202,11 +191,4 @@ if (document.querySelector("div.captcha_interstitial") != null) { // found a cap console.log("captcha found for " + location.href); } -if (document.getElementById("login_form") == null || UMBRA_FB_USER_NAME.indexOf("parameter")>0 || UMBRA_FB_PASSWORD.indexOf("parameter")>0 ) {//check for unset parameters - console.log("missing #login_form or login credentials; maybe already logged in for " + location.href); - var umbraIntervalId = setInterval(umbraIntervalFunc, 200); -} -else {//login - console.log("#login_form and credentials found for " + location.href); - umbraFacebookLogin(); -} +var umbraIntervalId = setInterval(umbraIntervalFunc, 200); diff --git a/setup.py b/setup.py index 2df83d2..3ac8a06 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def find_package_data(package): setuptools.setup( name='brozzler', - version='1.1b9.dev149', + version='1.1b9.dev150', description='Distributed web crawling with browsers', url='https://github.com/internetarchive/brozzler', author='Noah Levitt',