forked from rosette-api/nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
topics.js
26 lines (22 loc) · 1.16 KB
/
topics.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"use strict";
var Api = require("../lib/Api");
var ArgumentParser = require("argparse").ArgumentParser;
var parser = new ArgumentParser({
addHelp: true,
description: "Get the key phrases and concepts in a piece of text"
});
parser.addArgument(["--key"], {help: "Rosette API key", required: true});
parser.addArgument(["--url"], {help: "Rosette API alt-url", required: false});
var args = parser.parseArgs();
var api = new Api(args.key, args.url);
var endpoint = "topics";
var topics_data = "Lily Collins is in talks to join Nicholas Hoult in Chernin Entertainment and Fox Searchlight's J.R.R. Tolkien biopic Tolkien. Anthony Boyle, known for playing Scorpius Malfoy in the British play Harry Potter and the Cursed Child, also has signed on for the film centered on the famed author. In Tolkien, Hoult will play the author of the Hobbit and Lord of the Rings book series that were later adapted into two Hollywood trilogies from Peter Jackson. Dome Karukoski is directing the project."
var content = topics_data;
api.parameters.content = content;
api.rosette(endpoint, function(err, res){
if(err){
console.log(err);
} else {
console.log(JSON.stringify(res, null, 2));
}
});