How to query StackOverflow for the most recent, unanswered but upvoted, questions tagged "oink"

  • Download Gist
Oink questions on StackOverflow
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/env ruby
 
require 'zlib'
require 'open-uri'
require 'json'
 
 
io = Zlib::GzipReader.new(open("http://api.stackoverflow.com/1.0/questions?tagged=oink&sort=votes&min=1"))
obj = JSON.parse(io.read)
 
questions = obj['questions']
unanswered_questions = questions.reject { |q| q.has_key?('accepted_answer_id') }
 
unanswered_questions.each do |question|
puts "#{question['title']} http://stackoverflow.com/questions/#{question['question_id']}"
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.