Follow me to contact.

@大叮当与辉太狼

http://weibo.com/theraphy


What's new?

(2012/12/19) SET 22010
1. 所有代码转换为TASK异步,具体请见How to use.
(2012/12/18) SET 22003
1. Add TagApi class.
2. Add OAuth2.GetTokenInfo.
        /// <summary>
        /// 查询用户access_token的授权相关信息,包括授权时间,过期时间和scope权限。
        /// http://open.weibo.com/wiki/Oauth2/get_token_info
        /// </summary>
        /// <returns></returns>
        public TokenInfo GetTokenInfo()
3. 'users/show' & 'users/domain_show' -> UserApi.Show, delete UserApi.ShowByDomain.
        /// <summary>
        /// 根据用户ID获取用户信息
        /// http://open.weibo.com/wiki/2/users/show
        /// 通过个性化域名获取用户资料以及用户最新的一条微博
        /// http://open.weibo.com/wiki/2/users/domain_show
        /// 三个参数只能选择其中一项,其他设为 null
        /// </summary>
        /// <param name="uid">需要查询的用户ID。</param>
        /// <param name="screenName">需要查询的用户显示名</param>
        /// <param name="domain">需要查询的个性化域名</param>
        /// <returns></returns>
        public User Show(long? uid = null, string screenName = null, string domain = null)
4. 'tags/destroy' & 'tags/destroy_batch' -> TagApi.Destroy.
        /// <summary>
        /// 批量删除一组标签
        /// http://open.weibo.com/wiki/2/tags/destroy_batch
        /// 只能删除当前登录用户自己的标签
        /// </summary>
        /// <param name="tagIds">要删除的一组标签ID,以半角逗号隔开,一次最多提交10个ID。</param>
        /// <returns></returns>
        public IEnumerable<long> DestroyBatch(params long[] tagIds)
(2012/12/18) SET 22001
Project initialized.

What shall we do next?

1. Fix any bugs.
2. Improve the framework such as exception handling and async/await model.

Supported APIs

  • Basic AccountApi
  • Basic CommentApi
  • Basic CommonApi
  • Basic FavoriteApi
  • Basic FriendshipApi
  • Basic RegisterApi
  • Basic RemindApi
  • Basic SearchApi
  • Basic ShortUrlApi
  • Basic StatusApi
  • Basic UserApi
  • Basic TagApi

How to use?

1. Create your app at http://open.weibo.com and get the AppKey and AppSecret.
2. References WeiboWPSdk.dll & WeiboWPSdk.Json.dll
3. The following sample shows how to authorize and get the login user infomation.
            var oauth = new OAuth2("1232437654", "654df0473b8b8a0806e76a15f870a407");
            var result = await oauth.ClientLogin("lixiaolang87@qq.com", "lvdonghuilv1222");
            if (result) {
                var client = new WeiboClient(oauth);
                var user = await client.Api<UserApi>().Show(oauth.AccessToken.UId);
            }

Last edited Dec 18, 2012 at 11:53 PM by Theraphy, version 7