You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

newsquery

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

newsquery - npm Package Compare versions

Comparing version

to
0.1.6

2

package.json

@@ -9,3 +9,3 @@ {

"description": "The newsQuery NPM package provides a simple interface to BBC News Labs APIs",
"version": "0.1.5",
"version": "0.1.6",
"main": "./lib/newsquery.js",

@@ -12,0 +12,0 @@ "keywords": [

@@ -34,17 +34,20 @@ newsQuery

console.log(concepts);
/* Example response...
[ { name: 'Wayne Rooney',
uri: 'http://dbpedia.org/resource/Wayne_Rooney',
type: 'soccer player',
typeUri: 'http://dbpedia.org/ontology/SoccerPlayer',
thumbnail: 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Rooney_CL.jpg/200px-Rooney_CL.jpg' },
{ name: 'Mickey Rooney',
uri: 'http://dbpedia.org/resource/Mickey_Rooney',
type: 'person',
typeUri: 'http://dbpedia.org/ontology/Person',
thumbnail: 'http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Mickey_Rooney_still.jpg/200px-Mickey_Rooney_still.jpg' } ... ]
*/
});
```
Example response from getConcepts() / getConceptsByType():
``` javascript
[ { name: 'Wayne Rooney',
uri: 'http://dbpedia.org/resource/Wayne_Rooney',
type: 'soccer player',
typeUri: 'http://dbpedia.org/ontology/SoccerPlayer',
thumbnail: 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Rooney_CL.jpg/200px-Rooney_CL.jpg' },
{ name: 'Mickey Rooney',
uri: 'http://dbpedia.org/resource/Mickey_Rooney',
type: 'person',
typeUri: 'http://dbpedia.org/ontology/Person',
thumbnail: 'http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Mickey_Rooney_still.jpg/200px-Mickey_Rooney_still.jpg' } ]
````
### getConceptsByType()

@@ -87,31 +90,34 @@

console.log(articles);
/* Example response...
[ { primaryContentOf: 'http://www.bbc.co.uk/news/world-europe-27310008',
subject: 'Europe',
'@type': 'NewsItem',
tag: { '@set': [Object] },
primaryFormat: { '@id': 'http://www.bbc.co.uk/ontologies/creativework/TextualFormat' },
primaryTopicOf: 'http://www.bbc.co.uk/news/world-europe',
product: { '@id': 'http://www.bbc.co.uk/ontologies/bbc/NewsWeb' },
title: 'Everything you wanted to know about Europe but were afraid to ask',
description: 'Ahead of the elections for the European Parliament later this month, BBC Newsnight wants to hear your questions on all things EU.',
dateCreated: '2014-05-08T16:45:51Z',
'@id': 'http://www.bbc.co.uk/news/world-europe-27310008',
mentions: { '@set': [Object] },
identifier: '27310008' },
{ primaryContentOf: 'http://www.huffingtonpost.co.uk/2014/05/08/ukip-leaflets-eastern-europeans-cheap_n_5288745.html?utm_hp_ref=uk&ir=UK',
subject: 'UK - The Huffington Post',
'@type': 'NewsItem',
tag: { '@set': [Object] },
primaryFormat: { '@id': 'http://www.bbc.co.uk/ontologies/creativework/TextualFormat' },
product: { '@id': 'http://www.bbc.co.uk/ontologies/bbc/TheHuffingtonPost' },
title: 'Ukip Paid Eastern Europeans To Give Out Leaflets As \'They\'re Cheapest\'',
thumbnail: 'http://i.huffpost.com/gen/1780944/thumbs/s-FARAGE-POSTER-mini.jpg',
description: 'Ukip has defended their decision to employ Eastern Europeans to distribute election leaflets, despite the party regularly warning that EU migrants threaten British jobs, as the firm offered "the cheapest possible price". \nOn Wednesday, the Huffington Post UK revealed that Ukip had used a door-to-door distribution firm, which employed Eastern Europeans to hand out the party\'s leaflets. \nAndrew Spalis, distribution operative at door-to-door distribution firm Fast Leaflet , told HuffPostUK th...',
dateCreated: '2014-05-08T16:23:26Z',
'@id': 'http://www.huffingtonpost.co.uk/2014/05/08/ukip-leaflets-eastern-europeans-cheap_n_5288745.html?utm_hp_ref=uk&ir=UK',
mentions: { '@set': [Object] },
identifier: 'the_huffington_post_b187153f19eea9790e90ae8e1efc25c09860eb6b' } ... ]
*/
});
```
```
Example response from getArticlesByConcept():
``` javascript
[ { primaryContentOf: 'http://www.bbc.co.uk/news/world-europe-27310008',
subject: 'Europe',
'@type': 'NewsItem',
tag: { '@set': [Object] },
primaryFormat: { '@id': 'http://www.bbc.co.uk/ontologies/creativework/TextualFormat' },
primaryTopicOf: 'http://www.bbc.co.uk/news/world-europe',
product: { '@id': 'http://www.bbc.co.uk/ontologies/bbc/NewsWeb' },
title: 'Everything you wanted to know about Europe but were afraid to ask',
description: 'Ahead of the elections for the European Parliament later this month, BBC Newsnight wants to hear your questions on all things EU.',
dateCreated: '2014-05-08T16:45:51Z',
'@id': 'http://www.bbc.co.uk/news/world-europe-27310008',
mentions: { '@set': [Object] },
identifier: '27310008' },
{ primaryContentOf: 'http://www.huffingtonpost.co.uk/2014/05/08/ukip-leaflets-eastern-europeans-cheap_n_5288745.html?utm_hp_ref=uk&ir=UK',
subject: 'UK - The Huffington Post',
'@type': 'NewsItem',
tag: { '@set': [Object] },
primaryFormat: { '@id': 'http://www.bbc.co.uk/ontologies/creativework/TextualFormat' },
product: { '@id': 'http://www.bbc.co.uk/ontologies/bbc/TheHuffingtonPost' },
title: 'Ukip Paid Eastern Europeans To Give Out Leaflets As \'They\'re Cheapest\'',
thumbnail: 'http://i.huffpost.com/gen/1780944/thumbs/s-FARAGE-POSTER-mini.jpg',
description: 'Ukip has defended their decision to employ Eastern Europeans to distribute election leaflets, despite the party regularly warning that EU migrants threaten British jobs, as the firm offered "the cheapest possible price". \nOn Wednesday, the Huffington Post UK revealed that Ukip had used a door-to-door distribution firm, which employed Eastern Europeans to hand out the party\'s leaflets. \nAndrew Spalis, distribution operative at door-to-door distribution firm Fast Leaflet , told HuffPostUK th...',
dateCreated: '2014-05-08T16:23:26Z',
'@id': 'http://www.huffingtonpost.co.uk/2014/05/08/ukip-leaflets-eastern-europeans-cheap_n_5288745.html?utm_hp_ref=uk&ir=UK',
mentions: { '@set': [Object] },
identifier: 'the_huffington_post_b187153f19eea9790e90ae8e1efc25c09860eb6b' } ... ]
````