GithubHelp home page GithubHelp logo

node-wolfram's Introduction

wolfram Build Status

Wolfram is a simple Wolfram|Alpha API wrapper for Node.js with support for both plaintext and image results.

How to use

Register for a Wolfram|Alpha application ID. The Wolfram|Alpha® API is available for free for non-commercial experimental use with a low monthly cap on queries. For more information, visit http://products.wolframalpha.com/developers/. Wolfram is a registered trademark of the Wolfram Group of Companies.

Install the module with npm: $ npm install wolfram

Example usage:

var wolfram = require('wolfram').createClient("[CENSORED]")

wolfram.query("integrate 2x", function(err, result) {
  if(err) throw err
  console.log("Result: %j", result)
})

Running tests

Navigate to the project folder and run npm install to install the project's dependencies.

Run the following command, substituting your-app-id with your Wolfram|Alpha application ID.

$ WOLFRAM_APPID=your-app-id npm test

License

MIT

node-wolfram's People

Contributors

alanjames1987 avatar almanackist avatar andymeusel avatar cycomachead avatar justinsisley avatar kjsmita6 avatar strax avatar titanous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-wolfram's Issues

Run on heroku cedar?

Can this code run on 0.4.10? Any chance of a new release that supports that engine?

Wont build

Had build error with:

Windows 7 x64
Node V0.10.22
Npm: 1.3.14

Modifying pakcage.json:20 to

"libxmljs": "0.8.1"

resolved this

No "results" in the result ?

I started out trying to use the wolfram module for hubot (which is dependent on this package), but i noticed that although it was returning results, none of them were actual "results", I have now tested this standalone with your own example code and come to the same conclusion, am i being a total dunce and missing something here (i altered the question to make it batshit easy, i also changed the output so it was legible);

var wolfram = require('wolfram').createClient("[redacted]")
wolfram.query("1+1", function(err, result) {
if(err) throw err
console.log("result: %j", result);
})

to which i get the result;

[{"subpods":[{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"}],"primary":false},{"subpods":[{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"}],"primary":true},{"subpods":[{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"}],"primary":false},{"subpods":[{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"}],"primary":false},{"subpods":[{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"}],"primary":false},{"subpods":[{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"},{"title":"","value":"1+1","image":"http://www4c.wolframalpha.com/Calculate/MSP/MSP103931a568g5037df2i4f00004b4cb8ihf5e8h947?MSPStoreType=image/gif&s=5"}],"primary":false}]

which is great but doesn't really answer the question 😕 any help much appreciated

Error on require

I tried installing wolfram and requiring in Node, however, I get a weird error:

$ npm install wolfram
<snip>
$ node
> var wolfram = require('wolfram').createClient("kittens")
dyld: lazy symbol binding failed: Symbol not found: __ZN2v82V837AdjustAmountOfExternalAllocatedMemoryEi
  Referenced from: /Users/sirup/Dropbox/code/hubot/node_modules/wolfram/node_modules/o3-xml/lib/o3-xml/o3-darwin.node
  Expected in: flat namespace

dyld: Symbol not found: __ZN2v82V837AdjustAmountOfExternalAllocatedMemoryEi
  Referenced from: /Users/sirup/Dropbox/code/hubot/node_modules/wolfram/node_modules/o3-xml/lib/o3-xml/o3-darwin.node
  Expected in: flat namespace

Trace/BPT trap: 5 

Versions:

$ node --version
v0.8.4
$ npm --version
1.1.48

I'm a complete node noob, so I might be missing something obvious. :-)

Node.js API

Node 0.6 support

I'm running Node 0.6 and can't install this because it needs node ~> 0.4.7. Could it be tested and allowed to run on 0.6.X. That would be awesome.

Installing on Windows

Hi,

I had no troubles installing on Ubuntu but it didn't go so smoothly on Windows powershell. There seems to be an issue with Python version but also libxmljs?

gyp ERR! configure error
gyp ERR! stack Error: Python executable "C:\Users\kevin\AppData\Local\Programs\Python\Python35-32\python.EXE" is v3.5.0,
which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack at failPythonVersion (D:\Program Files\nodeJS\node_modules\npm\node_modules\node-gyp\lib\configure.js
:454:14)
gyp ERR! stack at D:\Program Files\nodeJS\node_modules\npm\node_modules\node-gyp\lib\configure.js:443:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:204:7)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at maybeClose (internal/child_process.js:829:16)
gyp ERR! stack at Socket. (internal/child_process.js:319:11)
gyp ERR! stack at emitOne (events.js:77:13)
gyp ERR! stack at Socket.emit (events.js:169:7)
gyp ERR! stack at Pipe._onclose (net.js:486:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "D:\Program Files\nodeJS\node.exe" "D:\Program Files\nodeJS\node_modules\npm\node_modules\node
-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Work\Equationary\node_modules\wolfram\node_modules\libxmljs
gyp ERR! node -v v4.5.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "D:\Program Files\nodeJS\node.exe" "D:\Program Files\nodeJS\node_modules\npm\bin\npm-cli.js" "ins
tall" "Wolfram"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs libxmljs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.