<commit_before>// ==UserScript==
// @name	FB Cleanup
// @include	https://www.facebook.com/*
// //@run-at document-end
// @version		1.0.7
// @grant		none
// ==/UserScript==

// Library
var waitFor = function ( locator, callBack ) {

	if ( typeof locator === 'string' ) {
		var check = document.querySelector( locator );

		if ( check ) {
			callBack( check );

		} else {
			setTimeout( function () {

				waitFor( locator, callBack );
			}, 1 );
		}
	}
};

if ( window.top === window.self ) {
	var FB      = {};
	var options = {
		'suggestedPosts'      : false,
		'sponsoredPosts'      : false,
		'likedPosts'          : false,
		'commentedOnPosts'    : false,
		'repliedToPosts'      : false,
		'wasTaggedInPosts'    : false,
		'sharedPosts'         : true,
		'viaPosts'            : true,
		'wasMentionedInPosts' : false,
		'appSuggestions'      : false,
		'trending'            : false,
		'suggestedPages'      : false
	};

	FB.suggestedPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'span' );
			var searchText = 'Suggested Post';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed sponsored post.' );
						target.style.display = 'none';
					}

				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i = 0; i < tags.length; i++ ) {

				if ( tags[ i ].textContent == searchText ) {
					loopBack( tags[ i ] );
				}
			}
		}
	};

	FB.sponsoredPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'a' );
			var searchText = 'Sponsored';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed sponsored post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i = 0; i < tags.length; i++ ) {

				if ( tags[ i ].textContent == searchText ) {
					loopBack( tags[ i ] );
				}
			}
		};
	};

	FB.likedPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'span' );
			var searchText = 'Sponsored';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed liked post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i in tags ) {

				if ( tags[ i ].textContent
					&& tags[ i ].textContent.indexOf( 'liked this' ) > -1
					&& getComputedStyle( tags[ i ] ).color.toString() == 'rgb(145, 151, 163)'
				) {
				    loopBack( tags[ i ] );
				}
			}
		}
	};

	FB.commentedOnPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'span' );
			var searchText = 'commented on';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed commented on post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i in tags ) {

				if ( tags[ i ].textContent
					&& tags[ i ].textContent.indexOf( searchText ) > -1
					&& getComputedStyle( tags[ i ] ).color.toString() == 'rgb(145, 151, 163)'
				) {
				    loopBack( tags[ i ] );
				}
			}
		};
	};

	FB.repliedToPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'span' );
			var searchText = 'replied to';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed replied to post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i in tags ) {

				if ( tags[ i ].textContent
					&& tags[ i ].textContent.indexOf( searchText ) > -1
					&& getComputedStyle( tags[ i ] ).color.toString() == 'rgb(145, 151, 163)'
				) {
				    loopBack( tags[ i ] );
				}
			}
		};
	};

	FB.wasTaggedInPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {
			var tags       = document.getElementsByTagName( 'span' );
			var searchText = ' was tagged in ';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed was tagged in post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}<commit_msg>Fix: some times tagged in is plural<commit_after>// ==UserScript==
// @name	FB Cleanup
// @include	https://www.facebook.com/*
// //@run-at document-end
// @version		1.0.8
// @grant		none
// ==/UserScript==

// Library
var waitFor = function ( locator, callBack ) {

	if ( typeof locator === 'string' ) {
		var check = document.querySelector( locator );

		if ( check ) {
			callBack( check );

		} else {
			setTimeout( function () {

				waitFor( locator, callBack );
			}, 1 );
		}
	}
};

if ( window.top === window.self ) {
	var FB      = {};
	var options = {
		'suggestedPosts'      : false,
		'sponsoredPosts'      : false,
		'likedPosts'          : false,
		'commentedOnPosts'    : false,
		'repliedToPosts'      : false,
		'wasTaggedInPosts'    : false,
		'sharedPosts'         : true,
		'viaPosts'            : true,
		'wasMentionedInPosts' : false,
		'appSuggestions'      : false,
		'trending'            : false,
		'suggestedPages'      : false
	};

	FB.suggestedPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'span' );
			var searchText = 'Suggested Post';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed sponsored post.' );
						target.style.display = 'none';
					}

				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i = 0; i < tags.length; i++ ) {

				if ( tags[ i ].textContent == searchText ) {
					loopBack( tags[ i ] );
				}
			}
		}
	};

	FB.sponsoredPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'a' );
			var searchText = 'Sponsored';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed sponsored post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i = 0; i < tags.length; i++ ) {

				if ( tags[ i ].textContent == searchText ) {
					loopBack( tags[ i ] );
				}
			}
		};
	};

	FB.likedPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'span' );
			var searchText = 'Sponsored';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed liked post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i in tags ) {

				if ( tags[ i ].textContent
					&& tags[ i ].textContent.indexOf( 'liked this' ) > -1
					&& getComputedStyle( tags[ i ] ).color.toString() == 'rgb(145, 151, 163)'
				) {
				    loopBack( tags[ i ] );
				}
			}
		}
	};

	FB.commentedOnPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'span' );
			var searchText = 'commented on';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed commented on post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i in tags ) {

				if ( tags[ i ].textContent
					&& tags[ i ].textContent.indexOf( searchText ) > -1
					&& getComputedStyle( tags[ i ] ).color.toString() == 'rgb(145, 151, 163)'
				) {
				    loopBack( tags[ i ] );
				}
			}
		};
	};

	FB.repliedToPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {

			var tags       = document.getElementsByTagName( 'span' );
			var searchText = 'replied to';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed replied to post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
			};

			for ( var i in tags ) {

				if ( tags[ i ].textContent
					&& tags[ i ].textContent.indexOf( searchText ) > -1
					&& getComputedStyle( tags[ i ] ).color.toString() == 'rgb(145, 151, 163)'
				) {
				    loopBack( tags[ i ] );
				}
			}
		};
	};

	FB.taggedInPosts = function () {

		this.events = [ 'scroll' ];
		this.run    = function () {
			var tags       = document.getElementsByTagName( 'span' );
			var searchText = ' tagged in ';
			var loopBack   = function ( target ) {

				if ( getComputedStyle( target ).borderLeftStyle === 'solid' ) {

					if ( target.style.display !== 'none' ) {
						console.log( 'Removed tagged in post.' );
						target.style.display = 'none';
					}
				} else if ( target.parentNode ) {
					loopBack( target.parentNode );
				}
{'fraction_non_alphanumeric': 0.15956315840340196, 'fraction_numerical': 0.006958538706871557, 'mean_word_length': 2.2246805858522904, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6664448', 'n_tokens_mistral': 4344, 'n_tokens_neox': 3416, 'n_words': 800}