Skip to content

Commit 7d9f131

Browse files
AlchemyDataNews - Add an example of querying data from the NewsAPI #156
1 parent e982545 commit 7d9f131

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

examples/alchemy_data_news.v1.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ var alchemy_data_news = watson.alchemy_data_news({
66
api_key: '<api_key>'
77
});
88

9+
// News about company acquisitions in the past 24 hours:
10+
// More information: http://docs.alchemyapi.com/docs/introduction
911
var params = {
1012
start: 'now-1d',
11-
end: 'now'
13+
end: 'now',
14+
count: 100,
15+
'q.enriched.url.enrichedTitle.relations.relation': '|action.verb.text=acquire,object.entities.entity.type=Company|',
16+
return: 'enriched.url.title'
1217
};
1318

1419
alchemy_data_news.getNews(params, function (err, news) {
1520
if (err)
1621
console.log('error:', err);
1722
else
1823
console.log(JSON.stringify(news, null, 2));
19-
});
24+
});

test/test.integration-all-services.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,10 @@ describe('integration-all-services', function() {
538538
it('getNews()', function(done) {
539539
alchemy_data_news.getNews({
540540
start: 'now-1d',
541-
end: 'now'
541+
end: 'now',
542+
count: 100,
543+
'q.enriched.url.enrichedTitle.relations.relation': '|action.verb.text=acquire,object.entities.entity.type=Company|',
544+
return: 'enriched.url.title'
542545
}, failIfError.bind(failIfError, done));
543546
});
544547
});

0 commit comments

Comments
 (0)