Package com.datasift.client.managedsource.sources

Examples of com.datasift.client.managedsource.sources.FacebookPage


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

        final DataSiftClient datasift = new DataSiftClient(config);

        FacebookPage source = new FacebookPage(config);
        String fbToken = "long-lived-facebook-api-token";

        source.addOAutToken(fbToken, "name", 1381406400);
        //username or id is valid
        source.addPage("theguardian", "https://www.facebook.com/theguardian", "a name for this");
        //or use the ID of the facebook page
        //source.addPage("10513336322", "https://www.facebook.com/theguardian", "a name for this");

        //enable options using
        source.enableComments(true)
                .enableLikes(true)
                .enablePostsByOthers(true);
        //or all at once
        source.setParams(true, true, true);
        ManagedSource managedSource = datasift.managedSource().create("My managed source", source).sync();
        if (managedSource.isSuccessful()) {
            //and now we can do filtering on this page e.g.
            Stream stream = datasift
                    .compile(String.format("interaction.content contains \"news\" AND source.id == \"%s\"",
View Full Code Here

TOP

Related Classes of com.datasift.client.managedsource.sources.FacebookPage

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.