<commit_before>define(['backbone', 'model/single', "moment"], function(Backbone, SingleModel) {

	var SubredditCollection = Backbone.Collection.extend({
		initialize: function(data) {
			_.bindAll(this);
			this.after = ""
			this.subName = data.subName
			this.sortOrder = data.sortOrder
			if (typeof this.sortOrder === 'undefined') {
				this.sortOrder = 'hot' //the default sort order is hot
			};
			//this.sortOrder = "/" + this.sortOrder //needs to start with a slash to be injected into the URL

			console.log('sort order=', this.sortOrder)
			this.count = 1
			this.instanceUrl = this.getUrl()

		},
		// Reference to this collection's model.
		model: SingleModel,

		url: function() {

			return this.instanceUrl //keeps a dynamic URL so we can give it a new "after"
		},

		getUrl: function() {

			var username = $.cookie('username')
			if (typeof username !== "undefined") {
				if (this.subName == "front") {
					return "/api/?url=" + this.sortOrder + ".json?after=" + this.after + "&cookie=" + $.cookie('reddit_session');
				} else {

					return '/api/?url=r/' + this.subName + "/" + this.sortOrder + ".json?after=" + this.after + "&sort=" + this.sortOrder + "&cookie=" + $.cookie('reddit_session');
				}
			} else {
				//if user is NOT logged in, use jsonp request
				if (this.subName == "front") {

					return "http://api.reddit.com/" + this.sortOrder + ".json?&after=" + this.after + "&jsonp=?"
				} else {
					return "http://api.reddit.com/" + this.sortOrder + ".json?&after=" + this.after + "&jsonp=?"
					//return '/api/?url=r/' + this.subName + this.sortOrder + ".json?after=" + this.after + "&sort=" + this.sortOrder + "&cookie=" + $.cookie('reddit_session');
				}
			}<commit_msg>was not getting correct subreddit when not logged in<commit_after>define(['backbone', 'model/single', "moment"], function(Backbone, SingleModel) {

	var SubredditCollection = Backbone.Collection.extend({
		initialize: function(data) {
			_.bindAll(this);
			this.after = ""
			this.subName = data.subName
			this.sortOrder = data.sortOrder
			if (typeof this.sortOrder === 'undefined') {
				this.sortOrder = 'hot' //the default sort order is hot
			};
			//this.sortOrder = "/" + this.sortOrder //needs to start with a slash to be injected into the URL

			console.log('sort order=', this.sortOrder)
			this.count = 1
			this.instanceUrl = this.getUrl()

		},
		// Reference to this collection's model.
		model: SingleModel,

		url: function() {

			return this.instanceUrl //keeps a dynamic URL so we can give it a new "after"
		},

		getUrl: function() {

			var username = $.cookie('username')
			if (typeof username !== "undefined") {
				if (this.subName == "front") {
					return "/api/?url=" + this.sortOrder + ".json?after=" + this.after + "&cookie=" + $.cookie('reddit_session');
				} else {

					return '/api/?url=r/' + this.subName + "/" + this.sortOrder + ".json?after=" + this.after + "&sort=" + this.sortOrder + "&cookie=" + $.cookie('reddit_session');
				}
			} else {
				//if user is NOT logged in, use jsonp request
				if (this.subName == "front") {

					return "http://api.reddit.com/" + this.sortOrder + ".json?after=" + this.after + "&jsonp=?"
				} else {
					return "http://api.reddit.com/r/" + this.subName + "/" + this.sortOrder + ".json?after=" + this.after + "&jsonp=?"
					//return '/api/?url=r/' + this.subName + this.sortOrder + ".json?after=" + this.after + "&sort=" + this.sortOrder + "&cookie=" + $.cookie('reddit_session');
				}
			}
{'fraction_non_alphanumeric': 0.18184421534936998, 'fraction_numerical': 0.000572737686139748, 'mean_word_length': 3.1782296650717705, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4595102', 'n_tokens_mistral': 1310, 'n_tokens_neox': 1125, 'n_words': 285}