<commit_before>/**
 * @author <NAME>
 *
 * @description Script to cheat on the Wikipedia Game (http://thewikigame.com/)
 */

// Appending jQuery to the DOM
var jqueryhtml = '<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>';
document.body.innerHTML += jqueryhtml;

// Setting the interval to check if the game has started
var checkInterval = 500 // ms

setInterval(function () {
	// Making sure the game is on the wiki page
	if ($('#wiki').length) {
		// Getting the endpage url
		var endURL = $('#endpagelink0').children('a').attr('href');
		var rawWikiURL = endURL.split('.org')[1];
		var linkID = 'cheaterlink';
		var appendHTML = '<a href="' + rawWikiURL + '" id="'+ linkID +'">';
		console.log($('#' + linkID).length);
		if ($('#' + linkID).length === 0) {
			$('#wiki').find('body').append(appendHTML);
			console.log('here');
		}
		console.log($('#wiki').contents().find('#' + linkID));
	}
}, checkInterval);<commit_msg>Generates workign link and adds it to the iframe correctly. Now I just need to find a way to make it actually click the link<commit_after>/**
 * @author <NAME>
 *
 * @description Script to cheat on the Wikipedia Game (http://thewikigame.com/)
 */

// Appending jQuery to the DOM
var jqueryhtml = '<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>';
document.body.innerHTML += jqueryhtml;

// Setting the interval to check if the game has started
var checkInterval = 500 // ms

setInterval(function () {

	// Making sure the game is on the wiki page
	if ($('#wiki').length) {

		// Getting the endpage url
		var endURL = $('#endpagelink0').children('a').attr('href');
		var rawWikiURL = endURL.split('.org')[1];

		// Constructing the HTML to be added to the page
		var linkID = 'cheaterlink';
		var appendHTML = '<a href="' + rawWikiURL + '" id="'+ linkID +'"></a>';

		var wikiBody = $('#wiki').contents().find('body');
		// Checking if the link has already been appended
		if ($('#' + linkID).length === 0) {
			wikiBody.append(appendHTML);
			console.log(wikiBody.contents());
		}

		// Clicking on the winning URL
		$('#' + linkID).each(function () {
			$(this).click();
		});
	}
}, checkInterval);
{'fraction_non_alphanumeric': 0.18738404452690166, 'fraction_numerical': 0.00927643784786642, 'mean_word_length': 3.77212389380531, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '27922', 'n_tokens_mistral': 739, 'n_tokens_neox': 680, 'n_words': 205}