Package com.google.buzz

Examples of com.google.buzz.Buzz


        userId = args[2];

        /**
         * Create a new instance of the API
         */
        Buzz buzz = new Buzz();

        /**
         * Get the url to authenticated the user. <br/>
         * The user has to grant access to this application, to manage Buzz Content.
         */
        String verificationUrl = buzz.getAuthenticationUrl( Buzz.BUZZ_SCOPE_READONLY, consumerKey, consumerSecret );

        /**
         * Redirect the user to the verificationUrl and read the verification code. <br/>
         * The new application should implement a similar method in order to get the verification
         * code from the google authentication website.<br/>
         * For development, we are lunching a browser locally and manually pasting the verification
         * code in the example console.
         */
        String verificationCode = ExampleUtils.getVerificationCode( verificationUrl );

        /**
         * Set the verificationCode (A.K.A. access token) to the API to be used on the request
         * signature, for authenticated requests.
         */
        buzz.setAccessToken( verificationCode );

        /**
         * Execute API method to retrieve the user consumption feed.
         */
        BuzzFeed feed = buzz.getPosts( userId, BuzzFeed.Type.CONSUMPTION );

        /**
         * Print results
         */
        System.out.println( feed.getFeedTitle() );
View Full Code Here


        userIdToFollow = args[3];

        /**
         * Create a new instance of the API
         */
        Buzz buzz = new Buzz();

        /**
         * Get the url to authenticated the user. <br/>
         * The user has to grant access to this application, to manage Buzz Content.
         */
        String verificationUrl = buzz.getAuthenticationUrl( Buzz.BUZZ_SCOPE_WRITE, consumerKey, consumerSecret );

        /**
         * Redirect the user to the verificationUrl and read the verification code. <br/>
         * The new application should implement a similar method in order to get the verification
         * code from the google authentication website.<br/>
         * For development, we are lunching a browser locally and manually pasting the verification
         * code in the example console.
         */
        String verificationCode = ExampleUtils.getVerificationCode( verificationUrl );

        /**
         * Set the verificationCode (A.K.A. access token) to the API to be used on the request
         * signature, for authenticated requests.
         */
        buzz.setAccessToken( verificationCode );

        /**
         * Execute API method to start following another user.
         */
        buzz.follow( userId, userIdToFollow );

        /**
         * Print results
         */
        System.out.println( "Now following " + userIdToFollow );
View Full Code Here

        userId = args[0];

        /**
         * Create a new instance of the API
         */
        Buzz buzz = new Buzz();

        /**
         * Execute API method to retrieve the user public feed.
         */
        BuzzFeed feed = buzz.getPosts( userId, BuzzFeed.Type.PUBLIC );

        /**
         * Print results
         */
        System.out.println( feed.getFeedTitle() );
View Full Code Here

        activityId = args[3];

        /**
         * Create a new instance of the API
         */
        Buzz buzz = new Buzz();

        /**
         * Get the url to authenticated the user. <br/>
         * The user has to grant access to this application, to manage Buzz Content.
         */
        String verificationUrl = buzz.getAuthenticationUrl( Buzz.BUZZ_SCOPE_READONLY, consumerKey, consumerSecret );

        /**
         * Redirect the user to the verificationUrl and read the verification code. <br/>
         * The new application should implement a similar method in order to get the verification
         * code from the google authentication website.<br/>
         * For development, we are lunching a browser locally and manually pasting the verification
         * code in the example console.
         */
        String verificationCode = ExampleUtils.getVerificationCode( verificationUrl );

        /**
         * Set the verificationCode (A.K.A. access token) to the API to be used on the request
         * signature, for authenticated requests.
         */
        buzz.setAccessToken( verificationCode );

        /**
         * Execute API method to delete a post.
         */
        BuzzFeedEntry entry = buzz.getPost( userId, activityId );

        /**
         * Print results
         */
        System.out.println( "Title: " + entry.getTitle() );
View Full Code Here

        comment = args[4];

        /**
         * Create a new instance of the API
         */
        Buzz buzz = new Buzz();

        /**
         * Get the url to authenticated the user. <br/>
         * The user has to grant access to this application, to manage Buzz Content.
         */
        String verificationUrl = buzz.getAuthenticationUrl( Buzz.BUZZ_SCOPE_WRITE, consumerKey, consumerSecret );

        /**
         * Redirect the user to the verificationUrl and read the verification code. <br/>
         * The new application should implement a similar method in order to get the verification
         * code from the google authentication website.<br/>
         * For development, we are lunching a browser locally and manually pasting the verification
         * code in the example console.
         */
        String verificationCode = ExampleUtils.getVerificationCode( verificationUrl );

        /**
         * Set the verificationCode (A.K.A. access token) to the API to be used on the request
         * signature, for authenticated requests.
         */
        buzz.setAccessToken( verificationCode );

        /**
         * Create the content of the post
         */
        BuzzContent buzzContent = new BuzzContent();
        buzzContent.setText( comment );

        /**
         * Execute API method to post an entry.
         */
        BuzzComment entry = buzz.createComment( userId, activityId, buzzContent );

        /**
         * Print creation results
         */
        System.out.println( "Comment created: " );
        System.out.println( "Content: " + entry.getContent().getText() );
        System.out.println( "Id: " + entry.getId() );
        System.out.println( "Published: " + entry.getPublished() + "\n" );

        /**
         * Update the comment
         */

        entry.getContent().setText( entry.getContent().getText() + " UPDATED!" );

        /**
         * Execute API method to update the comment.
         */
        BuzzComment updatedComment = buzz.updateComment( userId, activityId, entry.getId(), entry.getContent() );

        /**
         * Print update results
         */
        System.out.println( "Comment updated: " );
View Full Code Here

        link = args[4];

        /**
         * Create a new instance of the API
         */
        Buzz buzz = new Buzz();

        /**
         * Get the url to authenticated the user. <br/>
         * The user has to grant access to this application, to manage Buzz Content.
         */
        String verificationUrl = buzz.getAuthenticationUrl( Buzz.BUZZ_SCOPE_WRITE, consumerKey, consumerSecret );

        /**
         * Redirect the user to the verificationUrl and read the verification code. <br/>
         * The new application should implement a similar method in order to get the verification
         * code from the google authentication website.<br/>
         * For development, we are lunching a browser locally and manually pasting the verification
         * code in the example console.
         */
        String verificationCode = ExampleUtils.getVerificationCode( verificationUrl );

        /**
         * Set the verificationCode (A.K.A. access token) to the API to be used on the request
         * signature, for authenticated requests.
         */
        buzz.setAccessToken( verificationCode );

        /**
         * Create the content of the post
         */
        BuzzContent buzzContent = new BuzzContent();
        buzzContent.setText( content );
        buzzContent.setType( "text" );

        /**
         * Create the link that is going to be included in the post.
         */
        BuzzLink buzzLink = new BuzzLink();
        buzzLink.setHref( link );
        buzzLink.setRel( "Google Buzz Api" );
        buzzLink.setType( BuzzLink.Type.TEXT );

        /**
         * Execute API method to post an entry with a link.
         */
        BuzzFeedEntry entry = buzz.createPost( userId, buzzContent, buzzLink );

        /**
         * Print results
         */
        System.out.println( "Entry created: " );
View Full Code Here

        userId = args[2];

        /**
         * Create a new instance of the API
         */
        Buzz buzz = new Buzz();

        /**
         * Get the url to authenticated the user. <br/>
         * The user has to grant access to this application, to manage Buzz Content.
         */
        String verificationUrl = buzz.getAuthenticationUrl( Buzz.BUZZ_SCOPE_READONLY, consumerKey, consumerSecret );

        /**
         * Redirect the user to the verificationUrl and read the verification code. <br/>
         * The new application should implement a similar method in order to get the verification
         * code from the google authentication website.<br/>
         * For development, we are lunching a browser locally and manually pasting the verification
         * code in the example console.
         */
        String verificationCode = ExampleUtils.getVerificationCode( verificationUrl );

        /**
         * Set the verificationCode (A.K.A. access token) to the API to be used on the request
         * signature, for authenticated requests.
         */
        buzz.setAccessToken( verificationCode );

        /**
         * Execute API method to retrieve the user private feed.
         */
        BuzzFeed feed = buzz.getPosts( userId, BuzzFeed.Type.PRIVATE );

        /**
         * Print results
         */
        System.out.println( feed.getFeedTitle() );
View Full Code Here

        content = args[3];

        /**
         * Create a new instance of the API
         */
        Buzz buzz = new Buzz();

        /**
         * Get the url to authenticated the user. <br/>
         * The user has to grant access to this application, to manage Buzz Content.
         */
        String verificationUrl = buzz.getAuthenticationUrl( Buzz.BUZZ_SCOPE_WRITE, consumerKey, consumerSecret );

        /**
         * Redirect the user to the verificationUrl and read the verification code. <br/>
         * The new application should implement a similar method in order to get the verification
         * code from the google authentication website.<br/>
         * For development, we are lunching a browser locally and manually pasting the verification
         * code in the example console.
         */
        String verificationCode = ExampleUtils.getVerificationCode( verificationUrl );

        /**
         * Set the verificationCode (A.K.A. access token) to the API to be used on the request
         * signature, for authenticated requests.
         */
        buzz.setAccessToken( verificationCode );

        /**
         * Create the content of the post
         */
        BuzzContent buzzContent = new BuzzContent();
        buzzContent.setText( content );

        /**
         * Execute API method to post an entry.
         */
        BuzzFeedEntry entry = buzz.createPost( userId, buzzContent );

        /**
         * Print results
         */
        System.out.println( "Entry created: " );
View Full Code Here

TOP

Related Classes of com.google.buzz.Buzz

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.