diff --git a/checks.json b/checks.json new file mode 100644 index 0000000000..38306bf04a --- /dev/null +++ b/checks.json @@ -0,0 +1,16 @@ +["h1", + ".navigation", + ".logo", + ".blank", + ".about", + ".heading", + ".subheading", + ".pitch", + ".video", + ".thermometer", + ".order", + ".social", + ".section1", + ".section2", + ".faq", + ".footer"] diff --git a/grader.js b/grader.js new file mode 100755 index 0000000000..739eb46a78 --- /dev/null +++ b/grader.js @@ -0,0 +1,78 @@ +#!/usr/bin/env node +/* + +Automatically grade files for the presence of specified HTML tags/attributes. +Uses commander.js and cheerio. Teaches command line application development +and basic DOM parsing. + +References: + + + cheerio + - https://github.com/MatthewMueller/cheerio + - http://encosia.com/cheerio-faster-windows-friendly-alternative-jsdom/ + - http://maxogden.com/scraping-with-node.html + + + commander.js + - https://github.com/visionmedia/commander.js + - http://tjholowaychuk.com/post/9103188408/commander-js-nodejs-command-line-interfaces-made-easy + + + JSON + - http://en.wikipedia.org/wiki/JSON + - https://developer.mozilla.org/en-US/docs/JSON + - https://developer.mozilla.org/en-US/docs/JSON#JSON_in_Firefox_2 +*/ + +var fs = require('fs'); +var program = require('commander'); +var cheerio = require('cheerio'); +var HTMLFILE_DEFAULT = "index.html"; +var CHECKSFILE_DEFAULT = "checks.json"; +var rest = require('restler'); + +var assertFileExists = function(infile) { + var instr = infile.toString(); + if(!fs.existsSync(instr)) { + console.log("%s does not exist. Exiting.", instr); + process.exit(1); // http://nodejs.org/api/process.html#process_process_exit_code + } + return instr; +}; + +var cheerioHtmlFile = function(htmlfile) { + return cheerio.load(fs.readFileSync(htmlfile)); +}; + +var loadChecks = function(checksfile) { + return JSON.parse(fs.readFileSync(checksfile)); +}; + +var checkHtmlFile = function(htmlfile, checksfile) { + $ = cheerioHtmlFile(htmlfile); + var checks = loadChecks(checksfile).sort(); + var out = {}; + for(var ii in checks) { + var present = $(checks[ii]).length > 0; + out[checks[ii]] = present; + } + return out; +}; + +var clone = function(fn) { + // Workaround for commander.js issue. + // http://stackoverflow.com/a/6772648 + return fn.bind({}); +}; + +if(require.main == module) { + program + .option('-c, --checks ', 'Path to checks.json', clone(assertFileExists), CHECKSFILE_DEFAULT) + .option('-f, --file ', 'Path to index.html', clone(assertFileExists), HTMLFILE_DEFAULT) + .option('-u, --url ', 'Path to html link') + + .parse(process.argv); + var checkJson = checkHtmlFile(program.file, program.checks); + var outJson = JSON.stringify(checkJson, null, 4); + console.log(outJson); +} else { + exports.checkHtmlFile = checkHtmlFile; +} diff --git a/index.html b/index.html new file mode 100644 index 0000000000..4b627c53e2 --- /dev/null +++ b/index.html @@ -0,0 +1,300 @@ + + + + + Vocaloid 4.0 + + + + + + + + + + + + + + + +
+ +
+
+

Vocaloid 4.0

+
+
+
+
+ +

Better Speaking English Vocaloids

+
+
+
+
+ Placeholder +
+ +
+
+
+
+ +
+

1000

backers

+
+
+
+
+

$33,000

of $55,000

+
+
+
+
+

10

days left

+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+ + + Donate Bitcoins +
+
+
+ +
+
+
+ +
+
+ Placeholder +
+
+

+ *THIS IS FOR A CLASS - I DO NOT INTEND TO ACTUALLY DO THIS.Vocaloids are being wildly popular over the internet these days. Most of us know them from their character faces, but thats not exactly all a vocaloid has to offer. So what exactly is a vocaloid? Its actually a computer program that can sing a song when given the lyrics and pitch. Then its given a face and a name to helps fans associate the voice. However they have a huge problem: The English speaking ones are lacking proper pronouciation skills, not to mention the mechanical unlife-like voice! The Japanese are way ahead of the game, and have already integrated Vocaloids as part of their everchanging culture. Its time to change that -- and you can help! With a small donation, we can help pay for higher quality recording studios, singers, audio technitions, and artists, to help promote American Vocaloids and the Music industry. +

+
+
+ +
+
+

+ Why is promoting Vocaloids important? Because they are already super popular! Vocaloids hold huge fan-bases in Japan, United States, Canada, and Korea. Since the computer program is easy to use, it helps novice and professional song writers gain attention with their work without requiring much of the tools needed with a human singer. Popular Vocaloid characters are even turned into holograms with their own live concerts! This market hasnt reached its full potentioal yet, and the United States needs to pick up the pace. +

+
+
+ Placeholder +
+
+ + +
+
+

FAQ

+
+
+ +
+
+ Yes, donators will be given a copy of the Vocaloid program including the voicebank and a poster of the associated character. +
+
+
+
+ +
+
+ Suprisingly, just by browsing YouTube! There are thousands of songs in Japanese, English, and Korean. You can also browse www.vocaloid.com/en or checking out this informational video: http://www.youtube.com/watch?v=CF0A0I6cqmI (warning: its slightly outdated, but gets the point across.) +
+
+
+
+
+ +
+ + + +
+ + + + diff --git a/web.js b/web.js old mode 100644 new mode 100755 index 0b54a06391..c77123aa00 --- a/web.js +++ b/web.js @@ -1,12 +1,17 @@ +var fs = require('fs'); + var express = require('express'); var app = express.createServer(express.logger()); +var x = fs.readFileSync("index.html").toString(); + app.get('/', function(request, response) { - response.send('Hello World!'); + response.send(x); }); -var port = process.env.PORT || 5000; +var port = process.env.PORT || 8080; app.listen(port, function() { console.log("Listening on " + port); -}); \ No newline at end of file +}); +