Mercurial > altnet-hispano
view Agendas/trunk/src/Agendas.Twitter/oAuthTwitter.cs @ 200:5346c0500594 deploy pre 1.0
Pasando a estructura de db fija, ya no se crea automáticamente.
Se comenta lo referente a Patrocinadores que queda para alguna futura versión.
Script para tablas de v1.0
author | nelopauselli |
---|---|
date | Wed, 17 Aug 2011 17:54:45 -0300 |
parents | 734d3f0853bf |
children | 37ddf81333d3 |
line wrap: on
line source
using System; using AltNetHispano.Agendas.Configurations; 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 AgendasConfigurationManager.Publicadores.Twitter.SignIn.ConsumerKey; } } private string ConsumerSecret { get { return AgendasConfigurationManager.Publicadores.Twitter.SignIn.ConsumerSecret; } } 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); } public static string GetResponseContent(string response, string tagName) { var tagStart = "\"" + tagName + "\":"; var tagEnd = ","; var start = response.IndexOf(tagStart) + tagStart.Length; if (start > tagStart.Length) { var end = response.IndexOf(tagEnd, start); if (end > 0) { return response.Substring(start + 1, end - start - 2); } } return string.Empty; } } }