public static XDocument VerifyCredentials(ConsumerBase twitter, string accessToken)
 {
     IncomingWebResponse response = twitter.PrepareAuthorizedRequestAndSend(VerifyCredentialsEndpoint, accessToken);
     return XDocument.Load(XmlReader.Create(response.GetResponseReader()));
 }
Beispiel #2
0
        /// <summary>
        /// Gets the Gmail address book's contents.
        /// </summary>
        /// <param name="consumer">The Google consumer previously constructed using <see cref="CreateWebConsumer"/> or <see cref="CreateDesktopConsumer"/>.</param>
        /// <param name="accessToken">The access token previously retrieved.</param>
        /// <returns>An XML document returned by Google.</returns>
        public static XDocument GetContacts(ConsumerBase consumer, string accessToken)
        {
            if (consumer == null) {
                throw new ArgumentNullException("consumer");
            }

            var response = consumer.PrepareAuthorizedRequestAndSend(GetContactsEndpoint, accessToken);
            string body = response.GetResponseReader().ReadToEnd();
            XDocument result = XDocument.Parse(body);
            return result;
        }
 public static XDocument GetUpdates(ConsumerBase twitter, string accessToken)
 {
     IncomingWebResponse response = twitter.PrepareAuthorizedRequestAndSend(GetFriendTimelineStatusEndpoint, accessToken);
     return XDocument.Load(XmlReader.Create(response.GetResponseReader()));
 }
Beispiel #4
0
 public static XDocument GetAuthToken(ConsumerBase flickr, string accessToken)
 {
     IncomingWebResponse response = flickr.PrepareAuthorizedRequestAndSend(ServiceDescription.AccessTokenEndpoint, accessToken);
     return XDocument.Load(XmlReader.Create(response.GetResponseReader()));
 }