JavaScript + JQuery, 178 bytes
Quite a simple approach that makes the StackExchange API do all the work.
$.ajax('//api.stackexchange.com/search/advanced?sort=votes&closed=False&wiki=False¬ice=False&pagesize=5&site=codegolf').pipe(x=>x.items.map(x=>document.write(x.title+'<br>')))
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
a=x=>x.items.map(x=>document.write(x.title+'<br>'))
document.write('<script src="//api.stackexchange.com/search/advanced?sort=votes&closed=False&wiki=False&pagesize=5&site=codegolf&callback=a"><\/script>')
<!-- No dependencies, Pure JS. 204 bytes. -->
http://api.stackexchange.com/search/advanced?sort=votes&closed=False&wiki=False&pagesize=5&site=codegolf is the StackExchange API page that gives a JSON. This JSON data is the questions on codegolf.stackexchange.com sorted by votes where they haven't been closed and are not a wiki page and don't have a closed notice.
This is called with JQuery's $.ajax
, which works JSON-P. It adds a &callback=functionName
to the url so the API returns some javascript for a function that calls the data, so it can be used with the function that logs it.
<!-- For fun, do this for any site -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>StackExchange Site: <input value="codegolf"> <button onclick="$.ajax({success:x=>{try{document.getElementById('pre').innerHTML=x.items.map(x=>x.title).join('\n')+'\n\nQueries left: ' + x.quota_remaining}catch(e){try{document.getElementById('pre').textContent='Queries left: ' + (x.quota_remaining || 'Error')}catch(e){document.getElementById('pre').textContent='Error'}}},url:'//api.stackexchange.com/search/advanced?sort='+document.getElementById('s').value+'&closed=False&wiki=False¬ice=False&pagesize=5&site=' + this.previousElementSibling.value})">Go</button> Sort by: <select id='s'><option value="activity">Active</option><option value="votes" selected="selected">Score</option><option value="creation">New</option><!--option value="hot">Hot</option><option value="week">Week</option><option value="month">Month</option--></select><pre id="pre"></pre>
Some caveats while answering this question:
- StackExchange API always trys to returns gzipped data. In JS, the browser un-gzips for you.
- The API only seems to be able to return the top 100 at maximum, so if you were to filter out the closed questions programatically, you must assume that less than 96 of the top 100 questions are closed, which you can't so you have to do everything in the APIs query.
- The things in the API are HTML encoded, so you must also decode those. In JS, I let the browser decode it, but in something like Python, you must employ an external library, or else hard-code the dozens of entities.
That said, here is my Python solution that has to jump all of those hoops:
Python 3, 259 bytes
import urllib.request as r,gzip,html,json
for i in json.loads(gzip.decompress(r.urlopen('http://api.stackexchange.com/search/advanced?sort=votes&closed=False&wiki=False¬ice=False&pagesize=5&site=codegolf').read()))['items']:print(html.unescape(i['title']))