view Agendas/trunk/src/Agendas.Twitter/oAuthTwitter.cs @ 111:90ce239cfa6d

Tests sobre el publicador de twitter, cada track se pulica solo una vez
author Nelo@Kenia.neluz.int
date Wed, 08 Jun 2011 08:40:04 -0300
parents a456eb519e23
children 0bca45e1e664
line wrap: on
line source

using System;
using System.Configuration;

namespace AltNetHispano.Agendas.Twitter
{
	public class OAuthTwitter
	{
		private readonly ITwitterAdapter _twitterAdapter;

		public OAuthTwitter()
		{
			_twitterAdapter = new TwitterAdapter();
		}

		public OAuthTwitter(ITwitterAdapter twitterAdapter)
		{
			_twitterAdapter = twitterAdapter;
		}

		private string ConsumerKey
		{
			get { return ConfigurationManager.AppSettings["consumerKeyAppSignIn"]; }
		}

		private string ConsumerSecret
		{
			get { return ConfigurationManager.AppSettings["consumerSecretAppSignIn"]; }
		}

		public Uri AuthorizationLinkGet(string callbackAddress)
		{
			var request = _twitterAdapter.BuildAuthorizationUri(ConsumerKey, ConsumerSecret, callbackAddress);
			return request;
		}

		public string AccessTokenGet(string requestToken, string verifier)
		{
			return _twitterAdapter.GetAccessToken(ConsumerKey, ConsumerSecret, requestToken, verifier);
		}
	}
}