Skip to content

Instantly share code, notes, and snippets.

@push-gists
Last active August 3, 2018 12:53
Show Gist options
  • Save push-gists/d4d8d85405886a8f1d190c6acbd4e970 to your computer and use it in GitHub Desktop.
Save push-gists/d4d8d85405886a8f1d190c6acbd4e970 to your computer and use it in GitHub Desktop.
Create JSON topic in JS API
function createTopics(session){
console.log('Adding Topics...');
session.topics.add('twitter', new diffusion.topics.TopicSpecification(diffusion.topics.TopicType.JSON)).then(
function(result) {
console.log('JSON Topic Added : ' + result.topic);
// Start the updates to the topic
startStream(session);
},
function(error) {
console.log('JSON Topic Add Failed : ' + error);
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment