Package com.appspot.finajjarane.framework.social.impl

Source Code of com.appspot.finajjarane.framework.social.impl.Twitter

package com.appspot.finajjarane.framework.social.impl;

import java.util.List;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.social.twitter.api.Tweet;
import org.springframework.social.twitter.api.impl.TwitterTemplate;
import org.springframework.stereotype.Component;

import com.appspot.finajjarane.framework.generic.ApplicationConstants;
import com.appspot.finajjarane.framework.social.ITwitter;


@Component
@Scope(BeanDefinition.SCOPE_SINGLETON)
public class Twitter implements ITwitter {

  private TwitterTemplate twitter;

  public Twitter(){
    twitter = new TwitterTemplateApplicationConstants.TWITTER_CONSUMER_KEY,
                    ApplicationConstants.TWITTER_CONSUMER_SECRET,
                    ApplicationConstants.TWITTER_ACCESS_TOKEN,
                    ApplicationConstants.TWITTER_ACCESS_TOKEN_SECRET);
  }

  @Override
  public List<Tweet> getLatestTweets(){

    return twitter.timelineOperations().getHomeTimeline();

  }

}
TOP

Related Classes of com.appspot.finajjarane.framework.social.impl.Twitter

TOP
Copyright © 2018 www.massapi.com. 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.