summaryrefslogtreecommitdiffstats
path: root/samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-04-08 16:22:58 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-04-08 16:22:58 -0700
commitd9c0ee017807cc17132e9c760d274afffc9b981c (patch)
tree28a79463a760a10c4d67cbac48f9a6af5cd25b32 /samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs
parent1c3247abc8fb37405d0602e5037b3cebbe8e944a (diff)
downloadDotNetOpenAuth-d9c0ee017807cc17132e9c760d274afffc9b981c.zip
DotNetOpenAuth-d9c0ee017807cc17132e9c760d274afffc9b981c.tar.gz
DotNetOpenAuth-d9c0ee017807cc17132e9c760d274afffc9b981c.tar.bz2
Split up ITokenManager into two derived interfaces to better fit Consumer and Service Provider scenarios.
Diffstat (limited to 'samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs')
-rw-r--r--samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs28
1 files changed, 1 insertions, 27 deletions
diff --git a/samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs b/samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs
index cd90365..2a98ffe 100644
--- a/samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs
+++ b/samples/DotNetOpenAuth.ApplicationBlock/TwitterConsumer.cs
@@ -21,7 +21,7 @@ namespace DotNetOpenAuth.ApplicationBlock {
/// <summary>
/// The description of Twitter's OAuth protocol URIs.
/// </summary>
- private static readonly ServiceProviderDescription TwitterDescription = new ServiceProviderDescription {
+ public static readonly ServiceProviderDescription ServiceDescription = new ServiceProviderDescription {
RequestTokenEndpoint = new MessageReceivingEndpoint("http://twitter.com/oauth/request_token", HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest),
UserAuthorizationEndpoint = new MessageReceivingEndpoint("http://twitter.com/oauth/authorize", HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest),
AccessTokenEndpoint = new MessageReceivingEndpoint("http://twitter.com/oauth/access_token", HttpDeliveryMethods.GetRequest | HttpDeliveryMethods.AuthorizationHeaderRequest),
@@ -38,32 +38,6 @@ namespace DotNetOpenAuth.ApplicationBlock {
/// </summary>
private static readonly MessageReceivingEndpoint GetFriendTimelineStatusEndpoint = new MessageReceivingEndpoint("http://twitter.com/statuses/friends_timeline.xml", HttpDeliveryMethods.GetRequest);
- /// <summary>
- /// Initializes a new instance of the <see cref="WebConsumer"/> class that is
- /// prepared to communicate with Twitter.
- /// </summary>
- /// <param name="tokenManager">The token manager.</param>
- /// <param name="consumerKey">The consumer key.</param>
- /// <returns>The newly instantiated <see cref="WebConsumer"/>.</returns>
- public static WebConsumer CreateWebConsumer(ITokenManager tokenManager, string consumerKey) {
- return new WebConsumer(TwitterDescription, tokenManager) {
- ConsumerKey = consumerKey,
- };
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="DesktopConsumer"/> class that is
- /// prepared to communicate with Twitter.
- /// </summary>
- /// <param name="tokenManager">The token manager.</param>
- /// <param name="consumerKey">The consumer key.</param>
- /// <returns>The newly instantiated <see cref="DesktopConsumer"/>.</returns>
- public static DesktopConsumer CreateDesktopConsumer(ITokenManager tokenManager, string consumerKey) {
- return new DesktopConsumer(TwitterDescription, tokenManager) {
- ConsumerKey = consumerKey,
- };
- }
-
public static XDocument GetUpdates(ConsumerBase twitter, string accessToken) {
IncomingWebResponse response = twitter.PrepareAuthorizedRequestAndSend(GetFriendTimelineStatusEndpoint, accessToken);
return XDocument.Load(XmlReader.Create(response.GetResponseReader()));