<commit_before>http = require 'http'
express = require 'express'
coffeecup = require 'coffeecup'

app = express()
app.set('view engine', 'coffee')
app.engine 'coffee', require('coffeecup').__express

user = 'jeff-gerstmann'

getShowreel = (user, page, callback) ->

	showreelPath = '/'
	showreelPath += user
	showreelPath += '/showreel/?page='
	showreelPath += page.toString()

	options = {
		hostname: 'mixlr.com',
		port: 80,
		path: showreelPath,
		method: 'GET'
	}

	req = http.request options, (res) ->
		data = ''
		res.setEncoding('utf8')
		res.on 'data', (chunk) ->
			data += chunk
		res.on 'end', () ->
			startStr = data.indexOf "broadcasterData", 0
			lastStr = data.indexOf "}];", startStr
			evalData = "var "
			evalData += data.slice startStr, lastStr+3
			eval (evalData)
			callback { broadcasts, broadcasterData }
	req.end()

app.get '/', (req, res) ->
	page = 1

	if isFinite(req.query.page)
		page = req.query.page

	getShowreel user, page, (broadcasts, broadcasterData) ->
		res.render 'index', broadcasts, broadcasterData

app.listen 3000

console.log "Listening on 3000..."<commit_msg>-Changed port information into a proper variable<commit_after>http = require 'http'
express = require 'express'
coffeecup = require 'coffeecup'

app = express()
app.set('view engine', 'coffee')
app.engine 'coffee', require('coffeecup').__express

user = 'jeff-gerstmann'
port = 3000

getShowreel = (user, page, callback) ->

	showreelPath = '/'
	showreelPath += user
	showreelPath += '/showreel/?page='
	showreelPath += page.toString()

	options = {
		hostname: 'mixlr.com',
		port: 80,
		path: showreelPath,
		method: 'GET'
	}

	req = http.request options, (res) ->
		data = ''
		res.setEncoding('utf8')
		res.on 'data', (chunk) ->
			data += chunk
		res.on 'end', () ->
			startStr = data.indexOf "broadcasterData", 0
			lastStr = data.indexOf "}];", startStr
			evalData = "var "
			evalData += data.slice startStr, lastStr+3
			eval (evalData)
			callback { broadcasts, broadcasterData }
	req.end()

app.get '/', (req, res) ->
	page = 1

	if isFinite(req.query.page)
		page = req.query.page

	getShowreel user, page, (broadcasts, broadcasterData) ->
		res.render 'index', broadcasts, broadcasterData

app.listen port

console.log "Listening on "+port
{'fraction_non_alphanumeric': 0.15554573574900574, 'fraction_numerical': 0.010605391073795847, 'mean_word_length': 3.8793103448275863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1414305', 'n_tokens_mistral': 908, 'n_tokens_neox': 804, 'n_words': 197}