Hot answers tagged

12

Just wanted to let everybody know that I just made a new release of the library here. This release includes tons of bug fixes as well as some breaking changes which shouldn't be a problem if you have been running off the trunk. Also, by popular demand, I added a .Net 3.5 version of the library to this release. The hope here is to eventually have a mono ...


12

Good thing you didn't put a space in the name:


11

You can get around the json/simplejson easily in your wrapper. Just change your import line from import urllib2, json, httplib, datetime, operator to import urllib2, httplib, datetime, operator try: import json except ImportError: import simplejson as json That way you can just use json in the rest of your code, but client pythons will load ...


6

I am using Py-StackExchange in our Stack2Blog application. How do I retrieve a list of answers of a specific user using this wrapper? After retrieving a user object, the .answers member variable returns an empty list while I know the user does have posts.


6

Quite impressive - am looking forward for more! I'm afraid you'll need to change the library name soon though, as LINQToStackOverflow is at odds with the recently published Trademark Guidance, which explicitly asks for only one of the terms, "Stack" or "Exchange" or "Overflow" in your product name. So may I suggest the obvious: LINQ to Stack ;) Sounds ...


5

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 = "{ '...


5

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 ...


5

Usage Example: Stack Exchange Site Monitor JavaScript Site Monitor in 20 lines of code or less.... Demonstrates the use of Soapi.js to query stackauth.com to get an up-to-date list of Stack Exchange sites and then polling /stats for each one on a revolving timer. $(document).ready(function siteMonitor() { var apiKey = ''; new Soapi.RouteFactory(...


4

With the way the API is currently set up (lots of caching the info page says) is it possible to update the information on a question you've already looked at? I have a list of questions but, as time goes on, the information changes (# of answers, votes, etc) and I would like to be able to update the questions with the new info.


4

This is a nice implementation, but it doesn't work on Java ME nor Android though. You seem to be experienced Java developer, because you are using the adapter pattern design and some introspection stuff. The main problem here is that Java ME and Android don't provide the java.beans package which is needed in order to use introspection as you are using it... ...


4

This currently does not work with the v2.0 API.


4

The following is a quickly thrown together method that will return the accepted answer percentage of the user with the given ID. Note: This is using some code that will be available in the next release. Notice how it dramatically reduces complexity, and the length of code. public static double getAcceptedAnswerPercentage(StackWrapper sw, int userId) ...


4

Search Examples Questions You can search for questions with StackWrap4J by instantiating a StackWrapper then calling the search method. Before calling search, you have to create a SearchQuery, which is a simple parameter object. StackWrapper so = new StackOverflow(); SearchQuery query = new SearchQuery(); query.setTags("swing"); query.setNotTagged("...


4

Mkay, I've only used the part of the code that relates to StackAuth: You forgot to update the version number for SitesMethod and UsersByIdAssociatedMethod SitesMethod and UsersByIdAssociatedMethod both take $key as a parameter, but seeing as we've already inited the stackPHP object with the key, seems a bit redundant. I changed my SitesMethod function to ...


4

We (myself and Kyle), with graphical help from Nathan, developed an automatically generated image that pulls in the number of bounties, the total bounty rep value, and displays that in an image. It is part of the Ask Different Community Ads, and we're pretty proud of it. Thanks for developing Serel, it made the heavy lifting of StackExchange's API ...


3

Edit: My problem below has been "solved", and it's a problem with the fact that I'm getting back gzip-compressed data from stackapps. See the SO Answer. I'm still unsure why this happens only on my computer (possible reason: routers in my network adding content-headers), but I'm guessing this should be fixed in the wrapper itself. Come to think of it, the ...


3

Thanks for this super library! I've used it for my Overflow 7 app. (See also the Overflow 7 video.) I've put a few detailed comments on your Stacky codeplex discussion site. I hope they help. Thanks again, Stuart


3

Update 26-06-2010 PHPstack now works with SE API v0.9 and includes functions to retrieve data from StackAuth. Example of StackAuth sites function: <?php //assume $so is our PHPstack class $sites = $so->sites(); foreach($sites->body->api_sites as $site) { echo $site->name; } ?>


3

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 ...


3

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 ...


3

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 ...


3

Proxy Example Sometimes you need to use a Proxy to access the internet. At my company we need to. StackWrap4J provides the ability to specify a Proxy server to rout connections through. Below is a short code sample that configures the proxy, and then pulls every answer that I (2598) have given. Proxy prox = new Proxy(Proxy.Type.HTTP, new ...


3

Not sure if this is the right place for it, but I'm having some issues when I try and deploy this wrapper on a server as opposed to my local environment. First of all, I don't have SQLite3 on my server and do not have the ability to install it so I've set the caching to 0. Second, I have got it working perfectly on my local dev server that has internet ...


3

Example of Explicit Authentication: Explicit authentication is relatively straightforward with Stack.PY. Assuming you have already registered your application, the instructions look something like this: Visit your application's page to obtain the following information: key client ID client secret Provide Stack.PY with the above information: from ...


2

In the StackyClient.GetQuestions function, for the tags parameter, will you get questions with any of the tags in the array, or questions that have all of the tags in the array? Also I don't see really any documentation except for the page with a few examples, which don't explain what exactly the parameters do and stuff. If anyone could link me to a ...


2

When I try running the code with python 3.4 I always get this error: AttributeError: 'HTTPMessage' object has no attribute 'getheader' Here is the full traceback. I'd be very happy if any of you could tell me what the problem is. Is it the fact that I'm using python3? I converted the example files using 2to3 and it seems to me that it should work fine... ...


2

Possible bug in the latest build? Found this (excellent) library via a Bryce Boe post and dropped in Py-Stackoverflow via easy_install. Running the script triggered the following, however: sog@bishop:~/Dropbox/Code/StackOverflow$ ./minestack.py Traceback (most recent call last): File "./minestack.py", line 3, in <module> from stackexchange ...


2

OK, I'm probably missing the obvious, but how do I get the body of an answer? For example, in your code snippet: >>> so = stackexchange.Site('api.stackoverflow.com') >>> me = so.user(41981) >>> me.answers.fetch() >>> me.answers[0].body Traceback (most recent call last): File "<pyshell#45>", line 1, in <module&...


2

Total results vary with page size The idea of producing a transparent iterator (getting the next page as needed) is cool, but it just isn't working; the page size affects the total number of results returned (apparently to a multiple of the page size)...:-( My code needs to look at all Qs asked for a given tag in a given month: def qstats(site, tag, month,...


2

I am trying to use the Search option to get the list of results from SO. I have tried using pagesize=50 and I still get large number of titles returned. Is there another option to limit that search? Sorry if I am posting this the wrong way or in the wrong area but I am new to Stack Overflow and to programming as well :) This is the part of the code I am ...



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