Manually browserified cheerio.js. Edit 3 files, one in cheerio itself and two dependencies - lib/cheerio.js, - node_modules/domutils/index.js - node_modules/entities/index.js to replace dynamic "require" lines with static equivalents. Holds up to simple hand testing. cheerio is exposed in the browser as a global (window.cheerio).
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
license: gpl-3.0 |
Life expectancy data for countries, obtained from Wikipedia and plotted with pigshell
ycat http://en.wikipedia.org/wiki/List_of_countries_by_life_expectancy | hgrep -r 0 table.wikitable | table2js foo country data | iframe -g /usr/template/d3-worldmap1
Running through the pipeline step by step:
ycat
uses YQL to retrieve the contents of the Wikipedia page. We useycat
to jump the same-origin barrier.hgrep
selects HTML elements using a jQuery/CSS-like expression.table2js
converts the table contents into plain Javascript objects, the
Life expectancy data for countries, obtained from Wikipedia and plotted with pigshell on an orthographic projection. The template is based on Rotate the world by Jason Davies. Colors by Cynthia Brewer
ycat http://en.wikipedia.org/wiki/List_of_countries_by_life_expectancy | hgrep -r 0 table.wikitable | table2js foo country data | iframe -o proj=orthographic -g /usr/template/d3-worldmap1
Running through the pipeline step by step:
ycat
uses YQL to retrieve the contents of the Wikipedia page. We useycat
to jump the same-origin barrier.hgrep
selects HTML elements using a jQuery/CSS-like expression.table2js
converts the table contents into plain Javascript objects, the
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
parser = (function(){ | |
/* | |
* Generated by PEG.js 0.7.0. | |
* | |
* http://pegjs.majda.cz/ | |
*/ | |
function subclass(child, parent) { | |
function ctor() { this.constructor = child; } | |
ctor.prototype = parent.prototype; |
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
key | STATE_CODE | PC_NO | STATE | PC_NAME | 18-19 Male | 18-19 Female | 18-19 Others | Above 18 Male | Above 18 Female | Above 18 Others | Electors with EPIC | Electors with Photo | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AN1 | AN | 1 | ANDAMAN AND NICOBAR ISLANDS | ANDAMAN AND NICOBAR ISLANDS | 1529 | 1370 | 0 | 136356 | 121500 | 0 | 254093 | 254093 | |
AP1 | AP | 1 | ANDRA PRADESH | ADILABAD | 30191 | 20152 | 16 | 674909 | 686044 | 132 | 1361085 | 1361085 | |
AP2 | AP | 2 | ANDRA PRADESH | PEDDAPALLE | 23342 | 15088 | 19 | 702419 | 676669 | 93 | 1379181 | 1379181 | |
AP4 | AP | 4 | ANDRA PRADESH | NIZAMABAD | 23285 | 13463 | 5 | 701661 | 749739 | 64 | 1451464 | 1451464 | |
AP5 | AP | 5 | ANDRA PRADESH | ZAHIRABAD | 21456 | 11559 | 8 | 703663 | 712913 | 60 | 1416636 | 1416636 | |
AP3 | AP | 3 | ANDRA PRADESH | KARIMNAGAR | 24941 | 15453 | 8 | 755526 | 751194 | 67 | 1506787 | 1506787 | |
AP6 | AP | 6 | ANDRA PRADESH | MEDAK | 26421 | 14428 | 12 | 749671 | 737580 | 84 | 1487335 | 1487335 | |
AP7 | AP | 7 | ANDRA PRADESH | MALKAJGIRI | 49191 | 31744 | 20 | 1596146 | 1357475 | 294 | 2953915 | 2953915 | |
AP14 | AP | 14 | ANDRA PRADESH | BHONGIR | 22289 | 12421 | 7 | 739084 | 717775 | 44 | 1456903 | 1456903 |
NewerOlder