Comparing version 0.3.1 to 0.3.2
@@ -9,3 +9,3 @@ { | ||
"description": "The newsQuery NPM package provides a simple interface to BBC News Labs APIs", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"main": "./lib/newsquery.js", | ||
@@ -12,0 +12,0 @@ "keywords": [ |
@@ -61,3 +61,3 @@ newsQuery | ||
An example that returns the first 5 concepts matching the term "Rooney": | ||
For example, to get concepts related to "Ukraine": | ||
@@ -67,3 +67,3 @@ ``` javascript | ||
var newsQuery = require('newsquery')(apiKey); | ||
newsQuery.getRelatedConcepts("http://dbpedia.org/resource/Wayne_Rooney", 5) | ||
newsQuery.getRelatedConcepts("http://dbpedia.org/resource/Ukraine", 5) | ||
.then(function(concepts) { | ||
@@ -74,9 +74,9 @@ console.log(concepts); | ||
The response from findConcepts() is an array of concepts: | ||
The response from findConcepts() is an array of concepts, returned in order of how many co-occurences there are between the concepts. | ||
``` javascript | ||
[ { name: 'Mickey Rooney', | ||
uri: 'http://dbpedia.org/resource/Mickey_Rooney', | ||
typeUri: 'http://dbpedia.org/ontology/Person', | ||
image: 'http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Mickey_Rooney_still.jpg/200px-Mickey_Rooney_still.jpg' } ] | ||
[ name: 'Russia', | ||
uri: 'http://dbpedia.org/resource/Russia', | ||
occurrences: 9530, | ||
image: 'http://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Flag_of_Russia.svg/200px-Flag_of_Russia.svg.png' ] | ||
```` | ||
@@ -83,0 +83,0 @@ |
@@ -13,3 +13,3 @@ var assert = require("assert"); | ||
beforeEach(function(done){ | ||
newsquery.getRelatedConcepts("http://dbpedia.org/resource/David_Cameron") | ||
newsquery.getRelatedConcepts("http://dbpedia.org/resource/Ukraine") | ||
.then(function(concept) { | ||
@@ -16,0 +16,0 @@ response = concept; |
26115