Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

hacktober #118

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b62a1a3
Updated web.js
Jul 12, 2013
58e50f1
Added index.html
Jul 12, 2013
51784e2
Fixed web.js
Jul 12, 2013
cc7c568
Fixed web.js
Jul 12, 2013
24d4bf9
Fixed web.js
Jul 12, 2013
e52b7b1
Fixed index
Jul 12, 2013
136a742
Added grader and checks
Jul 13, 2013
8e88c6e
Grader checks html url
Jul 13, 2013
74548d3
Started fixing index.html
Jul 18, 2013
20e2496
Fixed index.html
Jul 19, 2013
33ea847
Error checking index.html
Jul 20, 2013
85ab7ce
Error checking index.html
Jul 20, 2013
69e8af2
Error checking index.html
Jul 20, 2013
ac5c12c
Error checking index.html
Jul 20, 2013
30ed3de
Error checking index.html
Jul 20, 2013
cdb1518
Error checking index.html
Jul 20, 2013
188427d
Error checking index.html
Jul 20, 2013
c7ff3f6
Error checking index.html
Jul 20, 2013
5ec4e33
Error checking index.html
Jul 20, 2013
f7a886f
Error checking index.html
Jul 20, 2013
26f3be2
Error checking index.html
Jul 20, 2013
6154f7c
Error checking index.html
Jul 20, 2013
8abe408
Error checking index.html
Jul 20, 2013
216f2b9
Error checking index.html
Jul 20, 2013
6099b2a
Error checking index.html
Jul 20, 2013
dd2a25d
Error checking index.html
Jul 20, 2013
657ddad
Error checking index.html
Jul 20, 2013
e998794
Error checking index.html
Jul 20, 2013
7b4ec26
Error checking index.html
Jul 20, 2013
404c205
Finally fixed index.html
Jul 20, 2013
357dcc3
Finally finished!
chawl002 Jul 20, 2013
78aa417
merge master fix
Jul 22, 2013
7cbb452
revert index.html from master
Jul 22, 2013
366aecc
product updating
Jul 23, 2013
d854a06
product updating
Jul 23, 2013
65eecdd
product updating
Jul 23, 2013
6a17062
Possibly finished?
Jul 23, 2013
e9b05a6
Possibly finished?
Jul 23, 2013
89422d4
Finished
Jul 23, 2013
3f0449f
fixing row-fluid bug
Aug 8, 2013
de1d478
Added new buttons~
Aug 8, 2013
e8fd099
Removed two buttons
Aug 8, 2013
e1d8d18
Removed two buttons
Aug 8, 2013
7601f61
Bitcoin button added
Aug 8, 2013
7ec959d
Notice putup
Aug 8, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
["h1",
".navigation",
".logo",
".blank",
".about",
".heading",
".subheading",
".pitch",
".video",
".thermometer",
".order",
".social",
".section1",
".section2",
".faq",
".footer"]
78 changes: 78 additions & 0 deletions grader.js
Original file line number Diff line number Diff line change
@@ -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 <check_file>', 'Path to checks.json', clone(assertFileExists), CHECKSFILE_DEFAULT)
.option('-f, --file <html_file>', 'Path to index.html', clone(assertFileExists), HTMLFILE_DEFAULT)
.option('-u, --url <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;
}
300 changes: 300 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Vocaloid 4.0</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://d396qusza40orc.cloudfront.net/startup%2Fcode%2Fbootstrap-combined.no-icons.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css">
<link rel="stylesheet" href="https://d396qusza40orc.cloudfront.net/startup%2Fcode%2Fsocial-buttons.css">
<script src="https://d396qusza40orc.cloudfront.net/startup%2Fcode%2Fjquery.js"></script>
<script src="https://d396qusza40orc.cloudfront.net/startup%2Fcode%2Fbootstrap.js"></script>
<link href="http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,300,400,600,700,800"
rel="stylesheet" type="text/css">
<style type="text/css">

/* Large desktop */
@media (min-width: 980px) {
body {
padding-top: 60px;
}
.linediv-l {
border-right: 1px white solid;
}
.linediv-r {
border-left: 1px white solid;
}
}

/* Landscape phones and down */
@media (max-width: 480px) {
.copy {
padding: 2.5% 10%;
}
.linediv-l {
border-bottom: 1px white solid;
}
.linediv-r {
border-top: 1px white solid;
}
}

/* All form factors */

/* Main body and headings */
body{
font-family: 'Open Sans', Helvetica, Arial, sans-serif;
}
.heading, .subheading {
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
text-align: center;
}
p.lead {
padding-top: 1.5%;
font-size: 24px;
line-height: 30px;
}
p {
font-size: 18px;
line-height: 24px;
}

/* Video pitch and Action */
.pitch {
padding: 2.5% 0%;
}
.order {
padding: 2% 0%;
}
.actions {
background-color: #343434;
padding: 3% 0%;
}
.video, .thermometer, .order, .social, .statistics {
text-align: center;
}
.statistics h3, .statistics p {
color: white;
}

/* Marketing Copy and Footer */
.copy {
padding-top: 2.5%;
padding-bottom: 2.5%;
text-align: justify;
}
.asset {
padding: 2.5% 0%;
}
.footer {
color: #cccccc;
text-align: center;
}
.footer p {
font-size: 11px;
}
.footer a {
color: #ccccff;
}
/* http://support.addthis.com/customer/portal/questions/1136093-share-buttons-in-center-position */
div.addthis_toolbox {
width:180px;
margin: 0 auto;
}
/*GA CODE*/
<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43043963-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>
</style>
</head>
<body>

<!-- Mobile-friendly navbar-->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar"
data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="#">Vocaloids 4.0</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>
</div>
</div>
</div>

<div class="container">

<div class="row-fluid heading">
<div class="span12">
<h1>Vocaloid 4.0</h1>
</div>
</div>
<div class="row-fluid subheading">
<div class="span12">

<p class="lead">Better Speaking English Vocaloids</p>
</div>
</div>
<div class="row-fluid pitch">
<div class="span5 offset1 video">
<img class="img-polaroid" alt="Placeholder" src="http://i269.photobucket.com/albums/jj78/dapokemon/mikumiku_zpsa5ea2954.jpg">
</div>

<div class="span5 actions">
<div class="span8 offset2">
<div class="row-fluid statistics">
<div class="span4">

<div class="linediv-l">
<h3>1000</h3> <p>backers</p>
</div>
</div>
<div class="span4">
<div class="linediv-c">
<h3>$33,000</h3> <p>of $55,000</p>
</div>
</div>
<div class="span4">
<div class="linediv-r">
<h3>10</h3> <p>days left</p>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span10 offset1">
<!-- Bootstrap progress bar -->

<div class="thermometer progress active">
<div class="bar bar-success" style="width: 60%;"></div>
<div class="bar bar-warning" style="width: 40%;"></div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6 offset3 order">

<!-- BITCOIN BUTTON-->
<a class="coinbase-button" data-code="fcd6b798a0c9347e7deb6e3a8e4d4a01" data-button-style="custom_large" href="https://coinbase.com/checkouts/fcd6b798a0c9347e7deb6e3a8e4d4a01">Donate Bitcoins</a><script src="https://coinbase.com/assets/button.js" type="text/javascript"></script>
</div>
</div>
<div class="row-fluid">
<div class="span8 offset2 social">
<!-- Social buttons-->
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5202f2fd4fee907d"></script>
<!-- AddThis Button END -->
</div>
</div>
</div>
</div>
<!-- Text boxes plus pics-->
<div class="row-fluid section1">
<div class="span5 offset1 asset">
<img class="img-polaroid" alt="Placeholder" src="http://i269.photobucket.com/albums/jj78/dapokemon/gumi_zps7c3227e9.jpg">
</div>
<div class="span5 copy">
<p>
*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.
</p>
</div>
</div>

<div class="row-fluid section2">
<div class="span5 offset1 copy copy-right">
<p>
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.
</p>
</div>
<div class="span5 asset">
<img class="img-polaroid" alt="Placeholder" src="http://i269.photobucket.com/albums/jj78/dapokemon/kaito_zps40d747a1.jpg">
</div>
</div>

<!-- FAQ -->
<div class="row-fluid faq">
<div class="span10 offset1">
<h3>FAQ</h3>
<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse"
data-parent="#accordion2" href="#collapseOne">
Will I be given anything for my donation?
</a>
</div>
<div id="collapseOne" class="accordion-body collapse">
<div class="accordion-inner">
Yes, donators will be given a copy of the Vocaloid program including the voicebank and a poster of the associated character.
</div>
</div>
</div>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse"
data-parent="#accordion2" href="#collapseTwo">
Where can I find out more about Vocaloids?
</a>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div class="accordion-inner">
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.)
</div>
</div>
</div>
</div>
</div>

</div>

<!-- License-->
<div class="row-fluid footer">
<div class="span12">
<p>This work is licensed under
the <a href="http://creativecommons.org/licenses/by-sa/3.0/">CC
By-SA 3.0
</a>, without all the cruft that would otherwise be
put at the bottom of the page.</p>
</div>
</div>
</div>
<!-- Tracking code -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-43043963-1', 'amazonaws.com');
ga('send', 'pageview');

</script>
</body>
</html>
Loading