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

I read the questions and answers. I am trying to learn R and SO is a good source.

I would find it useful, to find all the topics which were favourited by a lot of users.

Is there a way to search

[r] isfavorinted:1 orderby:#_of_stars

share|improve this question
2  
Be warned "favourting" doesn't necessary mean the content is good. People might bookmark for all sorts of reasons - to post an answer later, to check to see if the question's been improved, to remember to go back and down-vote tomorrow as they've run out of votes for today, and so on –  ChrisF Jan 23 '12 at 17:18
    
all answers did not introduce that SO has some query interface. and ti is called .SE and all answers use this –  user984532 Jan 26 '12 at 21:09
add comment

2 Answers 2

up vote 0 down vote accepted

Here's the query - insert any tag (for example, ) and enjoy!

-- Get the ID of the tag:
DECLARE @tagName NVARCHAR(25) = '##Tag##'
DECLARE @tagId INT = (SELECT TOP(1) Id From Tags WHERE TagName = @tagName)

-- Fetch the results:
SELECT TOP(50)
  'http://stackoverflow.com/q/' + CAST(Posts.Id AS VARCHAR) AS Url,
  Posts.* FROM Posts
  LEFT JOIN PostTags ON PostTags.PostId = Posts.Id
  WHERE PostTags.TagId = @tagId
  ORDER BY Posts.FavoriteCount DESC;

Dang, someone beat me to it :(

share|improve this answer
    
nice query, but you missed a couple of opportunities to use some of the Data.SE features described in the Data.SE faq. If you use the [Post Link] alias you'll get a link automatically generated. This is nice if the user changes the query to point to something other than SO. Also if you named your input ##Tag:string## you don't have to worry about the quotes. This is more important quotes might be in the input. –  Some Helpful Commenter Jan 23 '12 at 19:22
    
@ConradFrix: Yup, saw all of those in your answer :) –  minitech Jan 23 '12 at 19:48
    
the query does not add 'gem' tag to the problem and more addresses my original question –  user984532 Jan 26 '12 at 21:11
    
@user984532: Put gem as the tag then... –  minitech Jan 26 '12 at 21:14
add comment

Although the data does get stale you can use a Data.SE query for this

Here's one I wrote for you GEM Questions by FavoriteCount

Here's the SQL code for it

SELECT p.id [Post Link], 
       p.favoritecount 
FROM   posts p 
       INNER JOIN posttags pt 
         ON p.id = pt.postid 
       INNER JOIN tags t 
         ON pt.tagid = t.id 
WHERE  tagname = 'gem' 
       AND p.favoritecount > 0 
ORDER  BY p.favoritecount DESC 

Here's a query that takes in a tag name as an input Questions by FavoriteCount

share|improve this answer
add comment

You must log in to answer this question.

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