Show less
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){
function hideBodyForSponsoredPost(el, currentSection)
var sponsoredSections = [“walgreens”, “capital one”, “capital one csr”, “clorox powerful bleach”, “clorox clean transforms”, “dignity health”, “ford foundation”, “stand together”, “stand together against poverty”, “featured”];
if (sponsoredSections.includes(currentSection.toLowerCase()))
el.style.display = ‘none’;
function hideEmpty( parentId, childId) {
var parentDivs = document.getElementsByClassName(parentId);
if(parentId != undefined && parentId != null)
for(var i=0; i<parentDivs.length; i++)
if(parentDivs[i].children.length == 0)
parentDivs[i].style.display = "none";
if(childId != null) children.length == 0)
parentDivs[i].style.display = "none";
}
function addKeyweeTracking(url)
/*console.log("***** addKeyweeTracking *****");
console.log("URL: " + url);
console.log("***** addKeyweeTracking *****");*/
window.kwa("setCustomUrl" ,window.location.href+ "#"+Date.now());
window.kwa("sendPageView");
});
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
(function(h,o,t,j,a,r))(window,document,’https://static.hotjar.com/c/hotjar-‘,’.js?sv=’);
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
!function(f,b,e,v,n,t,s)
if(f.fbq)return;n=f.fbq=function()n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments);
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version=’2.0′;
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)(window, document,’script’,
‘https://connect.facebook.net/en_US/fbevents.js’);
fbq(‘init’, ‘1676218835946757’);
fbq(‘track’, ‘PageView’);
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
function triggerComscorePageView()
console.log(‘triggerComscorePageView’);
window.COMSCORE && COMSCORE.beacon(c1: “2”, c2: “18736521”);
fetch(“https://www.upworthy.com/res/3rdparty/comscore_pageview”);
if (typeof rblms !== ‘undefined’)
rblms.require([‘core/event_dispatcher’], function(eventDispatcher)
eventDispatcher.on(‘viewRegistry:initViews’, triggerComscorePageView);
);
document.addEventListener(‘click’, event =>
if (event.target && event.target.classList.contains(‘show-more’))
triggerComscorePageView()
);
urlChangeHandler(triggerComscorePageView);
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
(function()
tryvar a=”Untitled”,l3:”__page__”,l4:”-“,sa:””,sn:””,b=[],c;for(c in a)b.push(c+”=”+encodeURIComponent(a[c]));b=b.join(“&”);(new Image).src=”https://d26n2uyu5tcx3y.cloudfront.net?a=5ac31c1640c74c36900b97047f570f19″;var d=document.createElement(“script”);d.type=”text/javascript”;d.async=!0;var e=document.getElementsByTagName(“script”)[0];e.parentNode.insertBefore(d,e);d.src=”https://z.moatads.com/upworthy105Vonz37/moatcontent.js#”+bcatch(f)tryvar g=
“//pixel.moatads.com/pixel.gif?e=24&d=data%3Adata%3Adata%3Adata&i=MOATCONTENTABSNIPPET1&ac=1&k=”+encodeURIComponent(f)+”&j=”+encodeURIComponent(document.referrer)+”&cs=”+(new Date).getTime();(new Image).src=gcatch(h);
)();
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
(function(w,d) (window, document));
kwa(‘initialize’,603);
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
var tags = [
‘https://pymx5.com/scripts/ready.js’,
‘https://pymx5.com/scripts/ims.js’,
‘https://pymx5.com/scripts/load_tags.js’
]
function l()
if (tags.length)
var tag = tags.pop();
var script = document.createElement(‘script’);
script.setAttribute(‘src’, tag);
script.onload = l;
document.body.appendChild(script);
else function ()
(window.ia.q = window.ia.q
;
ia(‘track’, ‘PAGE_VIEW’);
docReady(function()
ims.startServices();
);
l();
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
if(window.location.href.split(‘?’)[0] === ‘https://www.upworthy.com/editorial-staff-2656063143’)
freestar.config.disabledProducts =
video: true
;
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
/*
*/
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
window.counter = 100;
window.createElementChangeListener(“.freestar-in-content”, function(wrapper)
var adDiv = document.createElement(“div”);
adDiv.id = “upworthy_incontent_desktop_”+window.counter;
var adScript = document.createElement(“script”)
adScript.setAttribute(“data-cfasync”,”false”);
adScript.innerHTML = `freestar.config.enabled_slots.push( placementName: “upworthy_incontent_desktop_1”, slotId: “upworthy_incontent_desktop_$window.counter” );`
adDiv.appendChild(adScript)
wrapper.appendChild(adDiv)
window.counter++;
)
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function()
var parag = document.querySelector(“.lead-media .widget__brief, .lead-media .body-description .rebellt-item, .lead-media .body-description”);
var widgetWrap = document.createElement(“div”);
widgetWrap.classList.add(“public-good-widget”);
var widget=”
”
widgetWrap.insertAdjacentHTML(“afterbegin”, widget);
var inAds = parag.querySelectorAll(‘.freestar-in-content’);
if (inAds)
if(inAds[inAds.length-1])
inAds[inAds.length-1].remove()
var lastAd = document.createElement(“div”);
lastAd.classList.add(“freestar-in-content”);
if(window.innerWidth 768)
ChangeListener(“[id^=upworthy_incontent_dynamic]”, function (item)
item.remove()
);
);
window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){
function fbvideoID(frame)
var myRegexp = /2F(d+)%/g;
var match = myRegexp.exec(frame);
return match[1];
var fbIframe = document.querySelector(‘iframe[src^=”https://www.facebook.com/plugins/video.php?”%5D’);
if (fbIframe) fvVidID = fbvideoID(fbIframe.getAttribute(‘src’));
if (fvVidID)
fbIframe.insertAdjacentHTML(“beforebegin”, ‘
‘);
// fbIframe.parentNode.removeChild(fbIframe);
var videoId = “promoted-video”;
var oldFacebookVideo = document.getElementById(videoId);
if (!oldFacebookVideo)
return
;
var facebookVideoPost = oldFacebookVideo.closest(“.widget”);
if (!facebookVideoPost)
return
;
var facebookVideo = facebookVideoPost.querySelector(“#” + videoId);
facebookVideo.classList.add(“fb-video”);
var firstPost = document.querySelector(“.widget.post-partial”);
function onScriptLoad()
FB.init(
appId: window.REBELMOUSE_BOOTSTRAP_DATA.fbId,
version: window.REBELMOUSE_BOOTSTRAP_DATA.fbAppVersion,
status: true,
cookie: true,
);
FB.XFBML.parse();
if(fbIframe)
fbIframe.parentNode.removeChild(fbIframe);
function loadFacebookScript()
var existingScript = document.querySelector(‘script[src=”https://connect.facebook.net/en_US/sdk.js”‘);
if (!existingScript)
var script = document.createElement(“script”);
script.src = “https://connect.facebook.net/en_US/sdk.js”;
document.head.appendChild(script);
script.addEventListener(“load”, onScriptLoad);
function intersectorCallback(video_player)
var booted = false;
var totalSeconds = 0;
var interval = null;
function impressionCounter()
totalSeconds++;
console.log(“I’ve been watching for ” + totalSeconds + ” seconds”);
return function intersector(entries)
var entry = entries[0];
if (entry.isIntersecting)
if (!booted)
booted = true;
video_player.mute();
video_player.play();
interval = setInterval(impressionCounter, 1000);
else
if (interval)
console.log(“I’ve stopped watching at ” + totalSeconds + ” seconds”);
clearInterval(interval);
interval = null;
;
function trackVideo(video_player)
var observer = new IntersectionObserver(intersectorCallback(video_player), );
observer.observe(facebookVideo);
function onFacebookElementLoaded(msg)
if (msg.type === “video” && msg.id === videoId)
trackVideo(msg.instance);
function onFacebookReady()
FB.Event.subscribe(“xfbml.ready”, onFacebookElementLoaded);
if (window.oldFacebookWaiter) window.oldFacebookWaiter();
if (“FB” in window)
onFacebookReady();
else
window.oldFacebookWaiter = window.fbAsyncInit;
window.fbAsyncInit = onFacebookReady;
loadFacebookScript();
});
Source link