Comments (3)
Okay, so the alternative topy_mini_racer
or js2py
is to actually just use node.
As a POC, create a file called blah.js
which has the following contents:
console.log('Hello World')
Then from the terminal, with node installed, you can run
$ node blah.js
Hello World
So how this would work is that one would have python download the js to be scraped, prepend exports={}
, append console.log(JSON.stringify(exports.BattlePokedex)
(or whatever), and then use os.system
to run node and capture the output. I'm willing to bet with some research I can figure out how to get node to run piped input instead of needing to execute a file.
Note that conda can install node just as easily as pip can install py_mini_racer
. Of course, conda doesn't work with pypy, but as long as my environment in TravisCI has node, this shouldn't be a problem--I'll just need to specify somewhere that node is needed to run Onix.
from onix.
Fine for now, since we're not worrying about PyPy compatibility
from onix.
Yeah, building py_mini_racer is nontrivial. Integrating with Travis (see: #40) required that we use a special environment (Ubuntu 14.04 rather than the standard 12.04), and then the only environments I've found where it'll build successfully are 3.5 and 2.7.
That's fine for now, since those are the two environments I'm targeting (and I'm not planning on deploying Onix anywhere that's running an Ubuntu older than 14.04), but this is actually a serious hindrance.
from onix.
Related Issues (20)
- Support new formats.js syntax
- Rethink moveset report strategy HOT 1
- Tests shouldn't depend on the formats of the moment HOT 3
- Update tests to use pytest.approx
- Onix is not actually pip-installable HOT 1
- Implement Concurrent Report Generation
- Implement Concurrent Log Processing
- Write Contributing Guide HOT 1
- Add Roadmap to documentation
- Add blog content to documentation
- Create installation / usage guide
- Consider switching to a less-permissive license HOT 2
- Abilities report DAO impl
- Backend support for Moveset Report
- Items report DAO impl
- Stats report DAO impl HOT 1
- Moves report DAO impl
- SQL backend: add indexes
- What's preventing Onix from being "in production"? HOT 1
- Drop default minimum turns to 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onix.