Last active
August 3, 2018 12:53
-
-
Save push-gists/d4d8d85405886a8f1d190c6acbd4e970 to your computer and use it in GitHub Desktop.
Create JSON topic in JS API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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