Tag Info

Hot answers tagged

5

Update Ok, I see from comments that you are using phone7 - the story is slightly different than mainstream silverlight as there is ONLY ClientHttp stack and you will need to manually decompress, as you have found out. I use Silverlight.SharpZipLib for this purpose. Good luck. Here is a method that will work in Silverlight and Phone 7. You can use it for ...


4

Soapi.CS Fluent Configuration var ctx = new ApiContext(ApiKey).Options // obviates a call to stackauth .SerializedSites("{ 'api_sites': [ {'name': 'Stack....") // can also be accomplished by seeding the cache .SeedCache(new RequestCacheItem { Uri = new Uri("http://stackauth.com/1.0/sites"), ResponseText = "{ ...


4

Asynchronous Requests Async requests can be made using the Site's RouteFactory. A salient use case for this functionality is using Soapi in Silverlight. [TestMethod, Asynchronous] public void AnswersByIdTestValid() { // The thing to be aware of is that the IEnumerable, lazyloading // model is synchronous, and since we are on the UI thread here ...


2

Soapi.CS Paged Results Pay particular attention to the third example; thats all 2800+ stack apps users in less than 5 seconds without breaking any rules. not too shabby. // Soapi elegantly handles multi-page requests. // Multi-paged requests are issued in parallel making data retrieval quick // get the default, 1 page of 30 using default sort var ...


2

Soapi.CS Full API Coverage // instantiate a context ApiContext ctx = new ApiContext("qgAq_KfDu0KYzlNG-qaTuw"); ctx.Initialize().AsyncWaitHandle.WaitOne(); // get a site Site sofu = ctx.Official.StackOverflow; // or Site stackapps = ctx.Sites.First(s=>s.ApiEndpoint == "http://api.stackapps.com"); --- // StackAuth Routes // /sites ...


2

Soapi Caching and Throttling Throttle All API requests made by Soapi are routed first through Soapi.Net.RequestCache and failing a cache hit, they are then routed through Soapi.Net.RequestThrottle. The throttle, which is described in detail here, works on a sliding window, allowing maximum request rate up to the prescribed limits, currently 30 per 5 ...


2

Soapi.CS - Full Parameter Parity Soapi provides full API coverage including parameters. [Test] public void info_param() { // /questions SO.Questions // answers (optional) When "true", the answers to a question will be returned .WithAnswers(true) // body (optional) When "true", a post's body will be included in the ...


2

Bulk Data Import This is a simple example of using Soapi.CS for bulk data importation. This sample creates/updates a SQLite database with the the complete profile of all Stack Exchange users with reputation >= 100 and assigns a rank according to order of appearance. Soapi processes the ~1000 requests required in less than 5 minutes. You may run this ...


2

Building a simple app with Soapi.CS Suppose you would like to build a complete dataset containing all of your content and activity for all of your accounts on all Stack Exchange sites. You would need to: Get a list of your accounts from stackauth /users/{id}/associated For each account Get all of your questions Get all of your answers Get all of your ...


2

MakerOfThings7: Why is SOAPICS GPL? That really limits it's usage. Can you change it to LGPL? http://soapics.codeplex.com/license My application is proprietary, and the GPL license requires that I distribute source of my app if I simply link to this library. That's a no-go for me. code poet: There are many reasons that this, and other libraries, are ...


1

These are rolling out, and should be on all API and StackAuth instances soon-ish.


1

Random thing to try, but I wonder if this is a compression issue? i.e. WebClient (on silverlight) is failing to decode GZIP of DEFLATE encoded data. What http headers do you send/receive? (via a network trace)


1

Source As an example of how leveraging Soapi.CS and the reusable controls in Soapi.Contrib.Silverlight can increase productivity when writing code against the API, I include the source code for the Soapi.Explore Silverlight application. // // Project: SOAPI // http://soapics.codeplex.com // http://stackapps.com/questions/386 // // Copyright 2010, ...


1

Source Code: As is the case with any application written using Soapi for api access, the code needed to get the data you want from the API is the least amount of code you have to write and by far the easiest to understand. Here is the source code for single page of the application. (There are several helper classes like value converters to format dates, ...



Only top voted, non community-wiki answers of a minimum length are eligible