bvalosek / showlist-austin-parser Goto Github PK
View Code? Open in Web Editor NEWParse the HTML from showlistaustin.com for upcoming live-music shows in Austin, TX
Home Page: https://showgoat.net
License: MIT License
Parse the HTML from showlistaustin.com for upcoming live-music shows in Austin, TX
Home Page: https://showgoat.net
License: MIT License
First off I would like to point out that I am a new to node and inexperienced when it comes to ES6 and babel.
Attempting to execute as instructed in your Usage docs. My end goal is to return all upcoming shows for a given day, in JSON format.
Getting an error, regenerator-runtime is not defined. I went into dist/AustinShowlistScraper.js and noticed that regenerator runtime was not explicitly defined as far as I could tell. So I went ahead and required it, which returned the following:
/node_modules/austin-showlist-scraper/dist/AustinShowlistScraper.js:11
var iterateElements = regeneratorRuntime.mark(
^
TypeError: undefined is not a function
at Object.<anonymous> (/Users/BloomINC/Desktop/testing/node_modules/austin-showlist-scraper/dist/AustinShowlistScraper.js:11:42)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/BloomINC/Desktop/testing/app.js:5:29)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
I then required generator-runtime at the root of my build and loged the output, and when checking for differences I noticed that 'default:' supersedes .mark , so I edited dist/AustinShowlistScraper.js like so:
"use strict";
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var _slicedToArray = function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); if (i && _arr.length === i) break; } return _arr; } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } };
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
var regeneratorRuntime = require("babel-runtime/regenerator");
var iterateElements = regeneratorRuntime.default.mark(
/**
* Convert a selector and cheerio context into iterable cheerio objects
*/
After running through the chain of logs erred and repeating includes accordingly. Logs checked out:
{ default:
{ wrap: [Function: wrap],
isGeneratorFunction: [Function],
mark: [Function],
awrap: [Function],
async: [Function],
keys: [Function],
values: [Function: values] },
__esModule: true }
[Function: iterateElements]
Questions:
Is this a bug or was I interfacing improperly?
I also cannot figure out how to mimic your babel configurations during batch transpilation. This however may be a gulp-babel issue but worth noting.
Is there a better way? Do I not need to transpile the script provided in your docs given my ES5 ENV?
What might you suggest given my end goal: to return all upcoming shows for a given day, in JSON format?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.