Package org.encuestame.social.api

Examples of org.encuestame.social.api.PlurkAPITemplate


            } else if (socialProvider.equals(SocialProvider.YAHOO)) {
                //FUTURE - Only valid on defined domain.
                log.debug("Yahoo provider is disabled");
               
            } else if (socialProvider.equals(SocialProvider.PLURK)) {
              PlurkAPIOperations  apiOperations = new PlurkAPITemplate(
                        apiKey, consumerSecret, accessToken.getValue(),
                        accessToken.getSecret());
                SocialUserProfile profile = apiOperations.getProfile();
                log.debug("plurk profile " + profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profile,
                            socialProvider, getUserAccount());
                } else {
                    log.warn("This account already exist");
                    throw new EnMeExistPreviousConnectionException(getMessage("social.repeated.account"));
                }
            } else if (socialProvider.equals(SocialProvider.TUMBLR)) {
              TumblrAPIOperations apiOperations = new TumblrAPITemplate(
                        apiKey, consumerSecret, accessToken.getValue(),
                        accessToken.getSecret());
                SocialUserProfile profile = apiOperations.getProfile();
                log.debug("linkedin profile "+profile.toString());
                final SocialAccount socialAccount = getSecurityService().getCurrentSocialAccount(socialProvider, profile.getId());
                if (socialAccount == null) {
                    getSecurityService().addNewSocialAccount(
                            accessToken.getValue(), accessToken.getSecret(), null, profile,
View Full Code Here


                log.error(e);
                e.printStackTrace();
            }
        } else if (socialAccount.getAccounType().equals(SocialProvider.PLURK)) {
            log.debug("Publish on PLURK");
            final PlurkAPIOperations tumblrAPIOperations = new PlurkAPITemplate(
                    EnMePlaceHolderConfigurer.getProperty("plurk.consumer.key"),
                    EnMePlaceHolderConfigurer.getProperty("plurk.consumer.secret"),
                    socialAccount.getAccessToken(),
                    socialAccount.getSecretToken());
            try {
                log.debug("Publish on Identica............>");
                published = tumblrAPIOperations.updateStatus(tweetText);
                log.debug("Publish on Identica...... "+published);
            } catch (Exception e) {
                published.setDatePublished(Calendar.getInstance().getTime());
                log.error(e);
                e.printStackTrace();
            }                   
        } else if (socialAccount.getAccounType().equals(SocialProvider.TUMBLR)) {
            log.debug("Publish on TUMBLR");
            final TumblrAPIOperations tumblrAPIOperations = new TumblrAPITemplate(
                    EnMePlaceHolderConfigurer.getProperty("tumblr.consumer.key"),
                    EnMePlaceHolderConfigurer.getProperty("tumblr.consumer.secret"),
                    socialAccount.getAccessToken(),
                    socialAccount.getSecretToken());
            try {
                log.debug("Publish on TUMBLR............>");
                published = tumblrAPIOperations.updateStatus(tweetText, socialAccount, hashtags);
                log.debug("Publish on TUMBLR...... "+published);
            } catch (Exception e) {
                published.setDatePublished(Calendar.getInstance().getTime());
                log.error(e);
                e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.encuestame.social.api.PlurkAPITemplate

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.