Exemple #1
0
        //private oAuthSina _oauth;
        public bool oAuth(string userid, string passwd, oAuthSina _oauth)
        {
            try
            {
                if (_oauth.Token == "" || _oauth.Token == null)
                {
                    string authLink = _oauth.AuthorizationSinaGet();
                    authLink += "&userId=" + userid + "&passwd=" + passwd + "&action=submit&oauth_callback=none";
                    string html = _oauth.WebRequest(oAuthSina.Method.POST, authLink, null);
                    string pin  = ParseHtml(html);
                    _oauth.Verifier = pin;
                    _oauth.AccessTokenGet(_oauth.Token);

                    return(true);
                }
                else
                {
                    _oauth.AccessTokenGet(_oauth.Token);
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
        }
Exemple #2
0
 public string delete_favorite(string id, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/favorites/destroy." + format + "?id=" + id;
     return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty);
 }
Exemple #3
0
 /*最新评论*/
 public string comments_timeline(string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/statuses/comments_timeline." + format;
     return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
 }
Exemple #4
0
 public string create_friendships(string userid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/friendships/create." + format + "?user_id=" + userid;
     return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty);
 }
Exemple #5
0
 /*批量获取一组微博的评论数及转发数*/
 public string counts(string userid, string passwd, string format, string ids)
 {
     oAuthSina _oauth = new oAuthSina();
     if (oAuth(userid, passwd, _oauth))
     {
         string url = "http://api.t.sina.com.cn/statuses/counts." + format + "?ids=" + ids;
         return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
     }
     else
         return null;
 }
Exemple #6
0
        /*回复微博评论*/
        public string status_replycomment(string twitterid, string commentcontent, string commentid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/reply." + format + "?cid=" + commentid + "&comment=" + commentcontent + "&id=" + twitterid;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty));
        }
Exemple #7
0
        public string status_destroy(string twitterID, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/destroy/" + twitterID.ToString() + "." + format;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty));
        }
Exemple #8
0
        /**********************************************************************************************
        *************************************账号接口*ok********************************************
        **********************************************************************************************
        **********************************************************************************************/
        //Login
        public string VerifyCredentials(string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/account/verify_credentials." + format;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
        }
Exemple #9
0
        /*最新评论*/
        public string comments_timeline(string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/comments_timeline." + format;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
        }
Exemple #10
0
        public string show_relationship(string userid, string targetid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/friendships/show." + format + "?source_id=" + userid + "&target_id=" + targetid;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
        }
Exemple #11
0
        public string reset_count(string type, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/reset_count." + format + "?type=" + type;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty));
        }
Exemple #12
0
        public string get_followers(string id, int count, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/followers." + format + "?id=" + id + "&count=" + count;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
        }
Exemple #13
0
        public string create_friendships(string userid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/friendships/create." + format + "?user_id=" + userid;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty));
        }
Exemple #14
0
        public string GetUserProfile(string userid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/users/show." + format + "?user_id=" + userid;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
        }
Exemple #15
0
        public string delete_favorite(string id, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/favorites/destroy." + format + "?id=" + id;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty));
        }
Exemple #16
0
        public string unread_message(string sinceid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/unread." + format + "?source=" + apiKey + "&with_new_status=1" + "&since_id=" + sinceid;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
        }
Exemple #17
0
        public string direct_messages(string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/direct_messages." + format;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
        }
Exemple #18
0
        /*上传图片并且发布一条微博信息 Basic&oAuth*/
        public string status_uploadbyoauth(string userid, string passwd, string format, string status,
                                           string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret,
                                           string filename, byte[] imageStream)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/upload." + format;

            return(_oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty, userid, passwd, filename, imageStream, status));
        }
Exemple #19
0
        /*获取单条ID的微博信息*/
        public string statuses_id(string userid, string passwd, string id, string uid)
        {
            oAuthSina _oauth = new oAuthSina();

            if (oAuth(userid, passwd, _oauth))
            {
                string url = "http://api.t.sina.com.cn/" + uid + "/statuses/" + id;
                return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
            }
            else
            {
                return(null);
            }
        }
Exemple #20
0
        /*最新公共微博*/
        public string public_timeline(string userid, string passwd, string format)
        {
            oAuthSina _oauth = new oAuthSina();

            if (oAuth(userid, passwd, _oauth))
            {
                string url = "http://api.t.sina.com.cn/statuses/public_timeline." + format;
                return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
            }
            else
            {
                return(null);
            }
        }
Exemple #21
0
        /*批量获取一组微博的评论数及转发数*/
        public string counts(string userid, string passwd, string format, string ids)
        {
            oAuthSina _oauth = new oAuthSina();

            if (oAuth(userid, passwd, _oauth))
            {
                string url = "http://api.t.sina.com.cn/statuses/counts." + format + "?ids=" + ids;
                return(_oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty));
            }
            else
            {
                return(null);
            }
        }
Exemple #22
0
        public List <string> GetToken(string userid, string passwd)
        {
            List <string> TokenList = new List <string>();

            oAuthSina _oauth = new oAuthSina();

            if (oAuth(userid, passwd, _oauth))
            {
                TokenList.Add(_oauth.Token);
                TokenList.Add(_oauth.TokenSecret);


                return(TokenList);
            }
            else
            {
                return(null);
            }
        }
Exemple #23
0
        /*转发一条微博信息*/
        public string status_repost(string id, string commentcontent, int isComment, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "";

            if (commentcontent.Length > 0)
            {
                url = "http://api.t.sina.com.cn/statuses/repost." + format + "?id=" + id + "&status=" + commentcontent + "&is_comment=" + isComment;
            }
            else
            {
                url = "http://api.t.sina.com.cn/statuses/repost." + format + "?id=" + id;
            }

            return(_oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty));
        }
Exemple #24
0
        /*发布一条微博信息*/
        public string statuses_update(string format, string status, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();

            _oauth.ConsumerKey    = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token          = apiToken;
            _oauth.TokenSecret    = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/update." + format;

            //System.Text.Encoding encoding = System.Text.Encoding.UTF8;
            //byte[] bytesToPost = encoding.

            //return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, "status=" + _oauth.UrlEncode(status));
            return(_oauth.oAuthWebRequest(oAuthSina.Method.POST, url, "status=" + UrlEncodePost(status)));

            //if (oAuth(userid, passwd, _oauth))
            //{
            //    string url = "http://api.t.sina.com.cn/statuses/update." + format + "?";
            //    return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, "status=" + _oauth.UrlEncode(status));
            //}
            //else
            //    return null;
        }
Exemple #25
0
        //private oAuthSina _oauth;
        public bool oAuth(string userid, string passwd, oAuthSina _oauth)
        {
            try
            {
                if (_oauth.Token == "" || _oauth.Token == null)
                {
                    string authLink = _oauth.AuthorizationSinaGet();
                    authLink += "&userId=" + userid + "&passwd=" + passwd + "&action=submit&oauth_callback=none";
                    string html = _oauth.WebRequest(oAuthSina.Method.POST, authLink, null);
                    string pin = ParseHtml(html);
                    _oauth.Verifier = pin;
                    _oauth.AccessTokenGet(_oauth.Token);

                    return true;
                }
                else
                {
                    _oauth.AccessTokenGet(_oauth.Token);
                    return true;
                }
            }
            catch
            {
                return false;
            }
        }
Exemple #26
0
 /**********************************************************************************************
  *************************************账号接口*ok********************************************
  **********************************************************************************************
  **********************************************************************************************/
 //Login
 public string VerifyCredentials(string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/account/verify_credentials." + format;
     return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
 }
Exemple #27
0
 public string unread_message(string sinceid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/statuses/unread." + format + "?source=" + apiKey + "&with_new_status=1" + "&since_id=" + sinceid;
     return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
 }
Exemple #28
0
        /*上传图片并且发布一条微博信息 Basic&oAuth*/
        public string status_uploadbyoauth(string userid, string passwd, string format, string status,
                                            string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret,
                                            string filename, byte[] imageStream)
        {
            oAuthSina _oauth = new oAuthSina();
            _oauth.ConsumerKey = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token = apiToken;
            _oauth.TokenSecret = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/upload." + format;

            return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty,userid,passwd,filename,imageStream,status);
        }
Exemple #29
0
        /*转发一条微博信息*/
        public string status_repost(string id, string commentcontent,int isComment, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();
            _oauth.ConsumerKey = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token = apiToken;
            _oauth.TokenSecret = apiTokenSecret;
            string url = "";
            if (commentcontent.Length > 0)
            {
                url = "http://api.t.sina.com.cn/statuses/repost." + format + "?id=" + id + "&status=" + commentcontent + "&is_comment=" + isComment;
            }
            else
            {
                url = "http://api.t.sina.com.cn/statuses/repost." + format + "?id=" + id;
            }

            return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty);
        }
Exemple #30
0
 /*回复微博评论*/
 public string status_replycomment(string twitterid, string commentcontent, string commentid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/statuses/reply." + format + "?cid=" + commentid + "&comment=" + commentcontent + "&id=" + twitterid;
     return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty);
 }
Exemple #31
0
        public string status_destroy(string twitterID, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();
            _oauth.ConsumerKey = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token = apiToken;
            _oauth.TokenSecret = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/destroy/" + twitterID.ToString() + "." + format;

            return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty);
        }
Exemple #32
0
        /*发布一条微博信息*/
        public string statuses_update(string format,string status, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
        {
            oAuthSina _oauth = new oAuthSina();
            _oauth.ConsumerKey = apiKey;
            _oauth.ConsumerSecret = apiKeySecret;
            _oauth.Token = apiToken;
            _oauth.TokenSecret = apiTokenSecret;
            string url = "http://api.t.sina.com.cn/statuses/update." + format;

            //System.Text.Encoding encoding = System.Text.Encoding.UTF8;
            //byte[] bytesToPost = encoding.

              //return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, "status=" + _oauth.UrlEncode(status));
            return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, "status=" + UrlEncodePost(status));

            //if (oAuth(userid, passwd, _oauth))
            //{
            //    string url = "http://api.t.sina.com.cn/statuses/update." + format + "?";
            //    return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, "status=" + _oauth.UrlEncode(status));
            //}
            //else
            //    return null;
        }
Exemple #33
0
 /**********************************************************************************************
  *************************************微博访问接口*********************************************
  **********************************************************************************************
  **********************************************************************************************/
 /*获取单条ID的微博信息*/
 public string statuses_show(string userid, string passwd, string format, string id)
 {
     oAuthSina _oauth = new oAuthSina();
     if (oAuth(userid, passwd, _oauth))
     {
         string url = "http://api.t.sina.com.cn/statuses/show/" + id + "." + format;
         return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
     }
     else
         return null;
 }
Exemple #34
0
 public string show_relationship(string userid, string targetid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/friendships/show." + format + "?source_id=" + userid +"&target_id=" + targetid;
     return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
 }
Exemple #35
0
 public string reset_count(string type, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/statuses/reset_count." + format + "?type=" + type;
     return _oauth.oAuthWebRequest(oAuthSina.Method.POST, url, String.Empty);
 }
Exemple #36
0
 /*最新公共微博*/
 public string public_timeline(string userid, string passwd, string format)
 {
     oAuthSina _oauth = new oAuthSina();
     if (oAuth(userid, passwd, _oauth))
     {
         string url = "http://api.t.sina.com.cn/statuses/public_timeline." + format;
         return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
     }
     else
         return null;
 }
Exemple #37
0
 public string GetUserProfile(string userid, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/users/show." + format + "?user_id=" + userid;
     return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
 }
Exemple #38
0
 public string get_followers(string id,int count, string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/statuses/followers." + format + "?id=" + id + "&count=" + count;
     return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
 }
Exemple #39
0
 public string direct_messages(string format, string apiKey, string apiKeySecret, string apiToken, string apiTokenSecret)
 {
     oAuthSina _oauth = new oAuthSina();
     _oauth.ConsumerKey = apiKey;
     _oauth.ConsumerSecret = apiKeySecret;
     _oauth.Token = apiToken;
     _oauth.TokenSecret = apiTokenSecret;
     string url = "http://api.t.sina.com.cn/direct_messages." + format;
     return _oauth.oAuthWebRequest(oAuthSina.Method.GET, url, String.Empty);
 }
Exemple #40
0
        public List<string> GetToken(string userid, string passwd)
        {
            List<string> TokenList = new List<string>();

            oAuthSina _oauth = new oAuthSina();
            if (oAuth(userid, passwd, _oauth))
            {
                TokenList.Add(_oauth.Token);
                TokenList.Add(_oauth.TokenSecret);

                return TokenList;
            }
            else
                return null;
        }