下载AMicroblog微博WPF版 下载AMicroblogAPI源代码
* What does AMicroblogAPI do?
AMicroBlogAPI is a C# implementation, a strong-typed deep encapsulation, a easy-to-use .net lib of SINA microblog APIs.
App developers no longer need to parse various HTTP responses -- all responses are parsed into strong types;
No longer need to construt the request query strings -- just simply gives the values of parameters;
No longer need to implement the OAuth -- a single call could logs the user on.
A brand new way to access SINA microblog (weibo.com) for .Net apps
(12/22/2011) AMicroblogAPI 2 is on its way... (targeting OAuth 2)
(11/04/2011) AMicroblog微博WPF版(an application of AMicroblogAPI) is now verified by SINA open platform.
(10/30/2011) AMicroblogAPI v1.0 is now released. Get it now!
(9/25/2011) A web-based (asp.net) demo app is now available in AMicroblogAPI SDK.
(9/12/2011) The brand new v2.0 demo app is now available for
download. Find out more detail features at AMicroblogAPI official microblog:
weibo.com/amicroblogapi
(9/7/2011) AMicroblogAPI is now a SINA recommended C# SDK. Follow AMicroblogAPI at weibo.com/amicroblogapi
<?xml version="1.0"?> <configuration> <appSettings> <add key="appKey" value="12313123"/> <add key="appSecret" value="asdasdasdas"/> </appSettings> ....
Adds AMicroBlogAPI.dll into your project's reference.
(To gain XML serialization performance, make sure AMicroBlogAPI.XmlSerializers.dll is deployed together with
AMicroBlogAPI.dll when you release your app)
Before call the APIs, make sure the AccessToken in Environment is well set.
To call a API, simply calls it like AMicroblog.APIName(parameters)
i.e:
// Sample code of calling a AMicroblog API public void Post(string status) { try { var updStatusInfo = new UpdateStatusInfo(); updStatusInfo.Status = status; var statusInfo = AMicroblog.PostStatus(updStatusInfo); // Further post-process against statusInfo... } catch (AMicroblogException aex) { // Handles the exception only if the exception is not handled by Unified Response Error Handling mechanism. if (!aex.IsHandled) { if (aex.IsRemoteError) { ShowErrorMessage("Server returned an error: {0}", aex.Message); // You can customize the error message based on aex.RemoteErrorCode. } else ShowErrorMessage("Unexpected error occured: {0}", aex.Message); } } catch (Exception ex) { ShowErrorMessage("Unexpected error occured: {0}", ex.Message); } }
For more information about response error handling, see Unified Response Error Handling.
Hint:
A demonstration app is included in AMicroblogAPI project to demonstrate how you can benefit from AMicroblogAPI while building an app from scratch.
All the APIs are with comments. You can look up the details of a particular API from the API document.
(use the http reqeust classes to customize your own API calls)
For issues, please mail to AMicroblogAPI@sina.com,
or visit AMicroblogAPI microblog at weibo.com/amicroblogapi
You are also welcome to visit My Microblog and enjoy.