<commit_before><html>
<head>
	<title>RSS Reader</title>
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
	<script src="http://ejohn.org/files/pretty.js"></script>

	<link rel="stylesheet" type="text/css" href="css/jquery.zrssfeed.css">

	<script type="text/javascript">


	 	// Item object for each feed to sort
	 	function Item(){
	 		this.title="";
	 		this.link="";
	 		this.description="";
	 		this.pubDate=new Date();
	 		this.guid="";
	 	}
	 	// END Item object for each feed to sort

	 	var feeds=[];

	 	var items=[];

	 	var parsing=0;

	 	$(document).ready(function(){
	 		// Check browser support
	 		if (typeof(Storage) != "undefined"){
	 			if(localStorage.getItem("feeds")!=null){
	 				loadRssFeeds();
	 			}
	 		} else {
	 			$("#body").html("<h1>YOUR BROWSER DOES NOT SUPPORT LOCAL STORAGE. PLEASE UPGRADE YOUR BROWSER.</h1>");
	 		}
	 	});

	 	function loadRssFeeds(){
	 		feeds=JSON.parse(localStorage.getItem("feeds"));
	 		$("#content").html("");
	 		$("#content").append("Currently active feeds: <br/>");
	 		feeds.forEach(function(feed){
	 			// ugly as fuck. see if it can be made a little nicer looking
	 			$("#content").append("<a href=\""+feed+"\">"+feed+"</a> <a onclick=\"removeRss('"+feed+"');\">X</a><br/>");
	 		});
	 		$("#content").append("<br/><br/>");
	 		// TODO actually query each seperate feed
	 		feeds.forEach(function(feed){
	 			$.ajax({
	 				type: "GET",
	 				url: "proxy.php?url="+feed,
	 				dataType: "xml",
	 				success: function(xml){
	 					loadFeed(xml);
	 				}
	 			});
	 			parsing++;
	 		});
	 	}

	 	function addRss(){
	 		rss=$("#newRss").val();
	 		feeds.push(rss);
	 		saveRssFeeds();
	 		loadRssFeeds();
	 	}

	 	function removeRss(feed){
	 		var i;
	 		feed=feed.trim();
	 		while((i = feeds.indexOf(feed)) !== -1) {
	 			feeds.splice(i, 1);
	 		}
	 		items=[];
	 		saveRssFeeds();
	 		loadRssFeeds();
	 	}

	 	function saveRssFeeds(){
	 		localStorage["feeds"]=JSON.stringify(feeds);
	 	}

	 	function loadFeed(xml){
	 		$(xml).find("channel").find("item").each(function(){
	 			item=new Item();
	 			item.title=$(this).find("title").text();
	 			item.link=$(this).find("link").text();
	 			// Parse out any html. Makes it much lighter to load than when sites try and embed html in their feeds
	 			item.description=$(this).find("description").text().replace(/<(?:.|)*?>/gm, '').replace('\n','<br />');
	 			item.date=$(this).find("pubDate").text();
	 			item.guid=$(this).find("guid").text();
	 			items.push(item);
	 		});
	 		parsing--;
	 	}

	 	// Display all the feeds once they've all been retreived
	 	$(document).ajaxStop(function(){
	 		while(parsing!=0){
	 			sleep(100);
	 		}

	 		items.sort(function(a,b){
	 			return new Date(b.date) - new Date(a.date);
	 		});

	 		for(i=0;i<items.length;i++){
	 			displayItem(items[i]);
	 		}

	 		$(".date").prettyDate();
			setInterval(function(){ $("date").prettyDate(); }, 5000);
	 	});

	 	function displayItem(item){
	 		$("#content").append(""+
	 			"<div class=rssFeed>"+
	 				"<div class=rssHeader>"+
	 					"<a href="+item.link+">"+item.title+"</a>"+"<span class=date>"+item.date+"</span>"+
	 				"</div>"+
	 				"<div class=rssBody>"+
	 					item.description+
	 				"</div>"+
	 			"</div>"+
	 			"");



	 	}



	 	function sleep(delay) {<commit_msg>Now displaying dates! Also stripped all embedded html in the feeds' description elements<commit_after><html>
<head>
	<title>RSS Reader</title>
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

	<link rel="stylesheet" type="text/css" href="css/jquery.zrssfeed.css">

	<script type="text/javascript">


	 	// Item object for each feed to sort
	 	function Item(){
	 		this.title="";
	 		this.link="";
	 		this.description="";
	 		this.pubDate=new Date();
	 		this.guid="";
	 	}
	 	// END Item object for each feed to sort

	 	var feeds=[];

	 	var items=[];

	 	var parsing=0;

	 	$(document).ready(function(){
	 		// Check browser support
	 		if (typeof(Storage) != "undefined"){
	 			if(localStorage.getItem("feeds")!=null){
	 				loadRssFeeds();
	 			}
	 		} else {
	 			$("#body").html("<h1>YOUR BROWSER DOES NOT SUPPORT LOCAL STORAGE. PLEASE UPGRADE YOUR BROWSER.</h1>");
	 		}
	 	});

	 	function loadRssFeeds(){
	 		feeds=JSON.parse(localStorage.getItem("feeds"));
	 		$("#content").html("");
	 		$("#content").append("Currently active feeds: <br/>");
	 		feeds.forEach(function(feed){
	 			// ugly as fuck. see if it can be made a little nicer looking
	 			$("#content").append("<a href=\""+feed+"\">"+feed+"</a> <a onclick=\"removeRss('"+feed+"');\">X</a><br/>");
	 		});
	 		$("#content").append("<br/><br/>");
	 		// TODO actually query each seperate feed
	 		feeds.forEach(function(feed){
	 			$.ajax({
	 				type: "GET",
	 				url: "proxy.php?url="+feed,
	 				dataType: "xml",
	 				success: function(xml){
	 					loadFeed(xml);
	 				}
	 			});
	 			parsing++;
	 		});
	 	}

	 	function addRss(){
	 		rss=$("#newRss").val();
	 		feeds.push(rss);
	 		saveRssFeeds();
	 		loadRssFeeds();
	 	}

	 	function removeRss(feed){
	 		var i;
	 		feed=feed.trim();
	 		while((i = feeds.indexOf(feed)) !== -1) {
	 			feeds.splice(i, 1);
	 		}
	 		items=[];
	 		saveRssFeeds();
	 		loadRssFeeds();
	 	}

	 	function saveRssFeeds(){
	 		localStorage["feeds"]=JSON.stringify(feeds);
	 	}

	 	function loadFeed(xml){
	 		$(xml).find("channel").find("item").each(function(){
	 			item=new Item();
	 			item.title=$(this).find("title").text();
	 			item.link=$(this).find("link").text();
	 			// Parse out any html. Makes it much lighter to load than when sites try and embed html in their feeds
	 			item.description=$(this).find("description").text().replace(/<(?:.|)*?>/gm, '').replace('\n','<br />');
	 			item.date=$(this).find("pubDate").text();
	 			item.guid=$(this).find("guid").text();
	 			items.push(item);
	 		});
	 		parsing--;
	 	}

	 	// Display all the feeds once they've all been retreived
	 	$(document).ajaxStop(function(){
	 		while(parsing!=0){
	 			sleep(100);
	 		}

	 		items.sort(function(a,b){
	 			return new Date(b.date) - new Date(a.date);
	 		});

	 		for(i=0;i<items.length;i++){
	 			displayItem(items[i]);
	 		}
	 	});

	 	function displayItem(item){
	 		$("#content").append(""+
	 			"<div class=rssFeed>"+
	 				"<div class=rssHeader>"+
	 					"<a href="+item.link+">"+item.title+"</a>"+"<span class=date>"+item.date+"</span>"+
	 				"</div>"+
	 				"<div class=rssBody>"+
	 					item.description+
	 				"</div>"+
	 			"</div>"+
	 			"");



	 	}



	 	function sleep(delay) {
{'fraction_non_alphanumeric': 0.2161339421613394, 'fraction_numerical': 0.004870624048706241, 'mean_word_length': 2.9512928442573663, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 65, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, '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': '7163761', 'n_tokens_mistral': 2947, 'n_tokens_neox': 2380, 'n_words': 418}