sleepybandit / oxford-dictionary Goto Github PK
View Code? Open in Web Editor NEWA nodeJS wrapper for using the oxforddictionary.com V2 REST API.
A nodeJS wrapper for using the oxforddictionary.com V2 REST API.
what is the structure or format to extract only "definitions" from the array? and have it log in console? Any help is greatly appreciated.
Using snippet provided, I'm getting this error:
Access to XMLHttpRequest at 'http://192.168.0.10:8080/sockjs-node/info?t=1573126923594' from origin 'http://localhost:8080' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
Any idea how to solve that issue?
In the NPM package page, the code in the setup section has this:
var config = { app_id : "YOUR_OXFORD_ACCOUNT_APP_ID", app_key : "YOUR_OXFORD_ACCOUNT_APP_KEY", source_lang : "en" };
This always returns { status_code: 500, status_text: 'JSON Parse Failed' }
because since version 2 of the API english GB and US have separate dataset names. This can be seen in the code of the actual package, where the value for that variable is defaulted to en-us. It can be fixed by changing the value to "en-us" or "en-gb" in your index file.
The NPM page should be updated with this little correction in order to prevent people from encountering this silly mistake.
This API is for which?
I cannot find oxforddictionary.com to retrieve API key
Hey Sleepy,
I am having issues on searching for definitions with the module.
When I use :
var lookup = dict.definitions("programming");
lookup.then(function(res) {
console.log(res);
},
function(err) {
console.log(err);
});
In functon variable I receive:
{ metadata: { provider: 'Oxford University Press' },
results:
[ { id: 'programming',
language: 'en',
lexicalEntries: [Array],
type: 'headword',
word: 'programming' } ] }
So where are the definitions?
When I switch the method to .find, like this:
var lookup = dict.find("programming");
I receive the same as the other method:
{ metadata: { provider: 'Oxford University Press' },
results:
[ { id: 'programming',
language: 'en',
lexicalEntries: [Array],
type: 'headword',
word: 'programming' } ] }
Can you help figure this out.
Thanks
Change line 15 from this:
var path = validate('/api/v1/entries/', props, this, 'entries');
to this:
var path = validate('/api/v1/entries/', props, this);
I am using this on my localhost, I am getting 'Authentication parameters missing' as a response. Is it a problem with my id and key?
Hey Sleepy,
Amazing work with the wrapper. I am getting a 500 error with “error parsing json string” when I use the directions from the readme. Could you please look into this?
Thanks x
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.