Package com.datasift.client.dynamiclist

Examples of com.datasift.client.dynamiclist.DataSiftDynamicList


public class DynamicListApi {
    private DynamicListApi() throws InterruptedException {
        DataSiftConfig config = new DataSiftConfig("username", "api-key");

        DataSiftClient datasift = new DataSiftClient(config);
        DataSiftDynamicList dynamiclist = new DataSiftDynamicList(config);

        DynamicList list = dynamiclist.create(DataSiftDynamicList.ListType.STRING, "example list").sync();
        if (list.isSuccessful()) {
            // create a stream that references the dynamic list, using the list_any operator
            Stream stream = datasift
                    .compile(String.format("interaction.content list_any \"%s\"", list.getId())).sync();

            // even after the stream was created, we can manipulate the list, even if the stream is running
            List<String> items = new ArrayList<>();
            items.add("keyword1");
            dynamiclist.add(list, items);

            System.out.println(list);
        }
    }
View Full Code Here

TOP

Related Classes of com.datasift.client.dynamiclist.DataSiftDynamicList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.