Bounty Contest:

Build anything using the Soapi.JS JavaScript wrapper and either post the code or a link to a live demo.

When the question gets old enough (7 days I think) I will click 'start a bounty' and offer up 300 points. Add the 50 bonus points that the site tacks on and the answer with the most votes when the bounty expires picks up a cool 350 rep and a link from http://soapi.info.

Use whatever tools and libraries float your boat, jquery, mootools, dojo etc, but interaction with the API must be driven by Soapi.JS.

Good luck and may the most ridiculous app win. ;-)

NOTE Time allowing, I will be happy to answer any questions about the library and help out with code if you get stuck. Simply post an answer describing your problem and any relevant code.

I was planning on playing with the soapi.js library in the next few days anyway, so this is some added incentive ;)
–
Mark HendersonJun 12 '10 at 7:59

Sounds like a challenge to me! I will begin planning something.
–
Nathan Osman♦Jun 12 '10 at 20:00

@smark - no worries dude. Now I see. I am going to delete my FRIST! that makes me look like a complete idiot now. thanks for the heads up, we can delete these comments if you like... unless you want to look like you are talking to your self ;p
–
Sky SandersJun 14 '10 at 17:47

@george - something to consider: stackapps.com/questions/707/… . r.e. your last question, soapi is a complete and faithful rendering of the so api. If the api exposes a method to do what you are asking then soapi provides a route and parameters to do the same. when in doubt use soapi-explore.
–
Sky SandersJun 14 '10 at 20:12

@George - start an answer and describe what you are trying to do and how you are getting stuck. and please delete all the support comments. comments are not a good place for support dialog as the 'comment' comments get buried.
–
Sky SandersJun 14 '10 at 22:26

3 Answers
3

Here is my entry. It basically allows you to embed the open-source ads from Meta in your blog, etc.

It is simply a .js file you can include on the page.

My evaluation: Soapi.js is a very intuitive library for JavaScript. And by that, I mean the methods are laid out in a way that you would expect them to be. The whole thing is relatively self-documenting and integrates well with my above-mentioned application. I especially like the fact that API changes don't require a huge code rewrite - only a quick download!

not that you have much competition but you should probably link to this answer from your announcement and beg for votes here as that will determine who picks up the check when the bounty expires. (I will not click check unless there are not enough votes (3 i think) for the site to pick the winner)
–
Sky SandersJun 16 '10 at 3:04

1

@code: Don't let the site pick! If you do, only half the bounty gets awarded. You will just have to pick it yourself.
–
Nathan Osman♦Jun 16 '10 at 3:13

ahhh, i did not consider that. looks like i have to pick. good catch
–
Sky SandersJun 16 '10 at 3:28

@code: In addition, did you see this page that I also made with Soapi.js? Vote for it here.
–
Nathan Osman♦Jun 21 '10 at 6:38

ding ding ding, winna winna big chicken dinna! for the record, now that the heated contest is concluded, this is exactly what I was looking for, a short sweet app written in a matter of hours leveraging the library. thanks for playing geo. r.e. votes-done and done.
–
Sky SandersJun 21 '10 at 7:21

btw, @code, the bounty system has changed and now you have to click 350 button on the answer you chosen. just accepting it won't work.
–
YOUJun 21 '10 at 7:28

I've got about 50% of the way through my JS app using your wrapper, but I'm heading back to work after some extended leave and there's no way I'm going to get it finished. That said, what I used worked great, only one suggestion, it would be great if the requests could be synchronous (rather than a-sync), because then when queuing up multiple requests to the same method you don't need to create a watcher.

E.G. I wanted to retrieve 5 individual questions, mixing and matching them from different sites. So:

then needs a setInterval to detect when all the responses have come back (increasing a progress meter along the way). Not a huge thing, probably won't upset too many people, but I found myself constantly creating watchers to then fire another function.

Apart from that, I applaud a job well done and I look forward to your 30" monitor winning application (although in my opinion you'll be hard pressed to beat Six to Eight - if it gets released before the cutoff date).

Hey, the rest of us haven't given up on the monitor either :)
–
Nathan Osman♦Jun 14 '10 at 7:18

1

Aside from the obvious dark pit of hades into which I would be thrown if I were able to implement a blocking call in JS, how to implement a blocking call in a jsonp wrapper is not immediately apparent to me. The api calls are made via jsonp, injected script tags, not XMLHttpRequest. Do you have any ideas? I have implemented a viable blocking call in the silverlight version, but then I have threads and am able to force the call to be made on a thread other than the UI thread. No such animal in regards to browsers (workers in chrome) in general distribution any time in the near future.
–
Sky SandersJun 14 '10 at 8:13

And I typically chain calls that would otherwise be suited to be run synchronously. e.g. make the next call from within the success function. With a little imagination and a flag or two this can serve such a purpose. And as far as a queue goes, I have an implementation somewhere in my qunit code. I will try to dig it up.
–
Sky SandersJun 14 '10 at 10:12

Writing a blocking jsonp call seems like it shouldn't even be possible :)
–
Nathan Osman♦Jun 14 '10 at 16:24

@code, as usual everything you've said sounds right... I was just too late into the design of my application to change it to one of the methods you mentioned. I didn't really put much thought into the idea to be honest, but I can see the problem that this is faced. I guess the answer is "no - next time design your app to use the library properly" ;)
–
Mark HendersonJun 14 '10 at 22:20

Can someone -1 this just so that it sits at the bottom of the list and doesn't get the bounty
–
Mark HendersonJun 16 '10 at 5:32

george, i already addressed this - you are trying to query an 'answer' source with a question id. try 53466, which is an answer id to see what I mean. AnswersById gets answers specifically requested. If you want all of the answers to a specific question, use QuestionsById or QuestionsByIdAnswers
–
Sky SandersJun 15 '10 at 0:36

and to answer your other question, yes, the api supports (but does not properly document) the ability to all of the answers for a specific question with a score of 6 or higher. Here is the raw url, api.meta.stackoverflow.com/0.8/questions/53346/… I will leave it to you to translate that into soapi.JS. (hint, the soapi was generated directly from the api)
–
Sky SandersJun 15 '10 at 0:41

And did I mention that I spend a LOT of time in soapi-explore. You don't use visual studio so soapi-explore can save you a lot of time with the parameter tooltip documentation. you can build requests and test them, see the results, and then very easily translate the url in to soapi.JS
–
Sky SandersJun 15 '10 at 0:44

Also - you will probably the reason you cannot find apiVersion on stats is that there is no member of that name. try api_version. Ok? If you have questions about a member of the api in it's running state look @ soapi.info/Services/Watch.aspx and see if you can figure it out.
–
Sky SandersJun 15 '10 at 22:08

@code: I know. My mobile client went crazy last night too and I had a feeling in the back of my mind that that's why your code wasn't working either. As for copying code, I just copied and pasted what you edited into my question above. Well, I'll get the new versions of the files and see what I can do.
–
Nathan Osman♦Jun 15 '10 at 22:24