What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

Now that we have an awesome tool StackExchange Data Explorer, won't its usefulness be multiplied manifolds if we could have a way of embedding queries onto a site that can fetch the results without the user having to actually go to the StackExchange website?


Something like this:

alt text

goes to

http://odata.stackexchange.com/stackoverflow/qt/5163/

select top 10 u.Id as [User Link], 
 (select sum(len(Body)) from posts where owneruserid = u.id) posts,
 (select sum(len(Text)) from comments where userid = u.id) comments,
 (select sum(len(Body)) from posts where owneruserid = u.id) +
 (select sum(len(Text)) from comments where userid = u.id) total
from users u
order by total desc

and produces the result

User Link        posts   comments total   
---------------- ------- -------- ------- 
Jon Skeet        6895871 1616661  8512532 
Marc Gravell     4454304 800243   5254547 
Alex Martelli    4018617 737938   4756555 
VonC             3688197 355679   4043876 
BalusC           3235636 740699   3976335 
Pascal Thivent   3298339 427297   3725636 
S.Lott           2473343 1177130  3650473 
paxdiablo        2870220 745320   3615540 
Jonathan Leffler 2663832 885100   3548932 
tvanfosson       2972126 564040   3536166 

(10 row(s) affected)

I am not an expert on web designing and might have not used the perfect language while describing this. So, if you find any technical faults with the question, please edit.

  • Can this be done already?
  • If not, what do you think about its usefulness?
share|improve this question
    
I'm not sure exactly how the URL system works, but if you inspect the "download results" link when you run the query, you can grab a CSV version of the results later on without visiting the site. Whether those results are available forever, or publicly, or are cached, I have no idea. Here's one I just ran: odata.stackexchange.com/meta/csv/3168?UserId=136558 –  Jon Seigel Jun 24 '10 at 18:43
1  
@Jon Seigel: Gives me a "Server Error in '/' Application.". –  Lazer Jun 24 '10 at 18:47
    
Well, so much for that idea. lol –  Jon Seigel Jun 24 '10 at 18:49
    
I need to figure out what is going on there –  waffles Jun 24 '10 at 22:04
    
In case everyone is looking for a ready made script I have create a script in PHP. meta.stackexchange.com/a/213197/219322 –  user219322 Dec 22 '13 at 20:55

1 Answer 1

Awesome Idea.

This can not be done yet but a patch is super welcome!

What I would really want is to have a way to embed stuff queries just like gist eg: <script src="http://gist.github.com/452054.js"></script> that way people can have a syntax highlighted runnable query embedded in their web page.

share|improve this answer
    
Maybe I'm misinterpreting the question, but I think what's being asked is for the ability to retrieve a result set without visiting the Data Explorer. So, you could have a semi-live set of stats embedded on a webpage, for example. (Can this be done using the API? I'm not familiar enough with it.) –  Jon Seigel Jun 24 '10 at 22:12
    
@Jon, yerp that is kind of the way gists work, you can embed them in your blog. I think this would be an awesome service to provide. The API can product results, but it does not do the fancy embed stuff yet. –  waffles Jun 25 '10 at 1:19
    
meta.stackexchange.com/a/213197/219322 –  user219322 Dec 22 '13 at 21:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .