This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:edbadb450210414c6ea44c2940914fd552299a2ed5624b1c1a1d7acf253e8144" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scraperwiki | |
import lxml.html | |
base_url = "http://www.tourisme.gouv.qc.ca/publications/bulletins_info/bulletin/heb_frequentation.php?mois=" | |
year_url = "&anneeHaut=" | |
tail_url = "&anneeBas=2012&soumettre=Comparer" | |
# Loop through years between 2000-2013 and months 1-12 | |
for year in range(2000,2014): | |
for month in range(1,13): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.button').click(function(e) { | |
e.preventDefault(); | |
$href = $(this).attr('href'); | |
$('#viewer').scrollTo( $($href), 800, {offset: {top:-5} }); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script id="handlebars-template" type="text/x-handlebars-template"> | |
<div id="card"> | |
<div id="{{rowNumber}}"></div> | |
<div class="top"><span class="title">{{team}} </span></div> | |
<div class="team column"> | |
<strong>Established: </strong>{{established}}<br /> | |
<strong>First Grand Prix:</strong> {{firstgrandprix}} <br /> | |
<strong>First victory:</strong> {{firstvictory}}<br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// Assign Google spreadsheet URL to variable | |
var public_spreadsheet_url = 'https://docs.google.com/spreadsheet/pub?key=0ArP8859PKYs8dEpUQ3hLejA1TVo1cWxPbnBVNy11TGc&output=html'; | |
$(document).ready( function() { | |
// Initialize Tabletop with whatever options you want | |
Tabletop.init( { key: public_spreadsheet_url, | |
callback: showInfo, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript" src="js/handlebars.js"></script> | |
<script type="text/javascript" src="js/tabletop.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#mothertongue,#knowledge').change(function (element) { | |
layer.setOptions({ | |
styles: getStyles(element) | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var step = maxima[column] / 5; | |
var styles = []; | |
for (var i = 0; i <= 4; i++) { | |
styles.push({ | |
where: "'" + column + "' >= " + (step * i) + " AND '" + column + "' < " + (step * (i + 1)), | |
polygonOptions: { | |
fillOpacity: 0.4, | |
fillColor: colors[i] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getStyles(element) { | |
var $mothertongue = $('#mothertongue'), | |
$knowledge = $('#knowledge'), | |
mothertongue = $mothertongue.val(), | |
knowledge = $knowledge.val(); | |
if (mothertongue == 'NO' || knowledge == 'Both' || knowledge == mothertongue) { | |
column = 'MT: ' + mothertongue + ', Kn: ' + knowledge; | |
} | |
else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var maxima= { | |
'MT: Eng, Kn: Eng': 1500, | |
'MT: Eng, Kn: Both': 3250, | |
'MT: Fra, Kn: Fra': 7660, | |
'MT: Fra, Kn: Both': 4700, | |
'MT: NO, Kn: Eng': 2290, | |
'MT: NO, Kn: Fra': 1830, | |
'MT: NO, Kn: Both': 2980, | |
}; |
NewerOlder