3 ms·
Ask HN: Can I filter submissions by domain TLD?
I’d like to filter the HN submissions where the provided URL ends in .fr, to find blogs or personal websites of Frenchies. Is that possible?
I tried the obvious /from?site=*.fr but it doesn’t seem to be available
- gabrielsroka 5y agohttps://hn.algolia.com/api/v1/search?query=.fr/&restrictSearchableAttributes=url https://hn.algolia.com/api/v1/search?query=.fr/&restrictSear... Or https://hn.algolia.com/api/v1/search_by_date?query=.fr/&restrictSearchableAttributes=url https://hn.algolia.com/api/v1/search_by_date?query=.fr/&rest... See restrictSearchableAttributes=url in https://hn.algolia.com/api https://hn.algolia.com/api Then maybe some JavaScript: javascript:console.table(JSON.parse(document.body.innerText).hits.map(h => ({title: h.title, url: h.url, dt: h.created_at}))) The results aren't perfect. You could do more filtering on the client side.
- gabrielsroka 5y agoHere's a version with client side filtering. https://jsfiddle.net/hoyxL3u0/ https://jsfiddle.net/hoyxL3u0/
- detaro 5y agohttps://hn.algolia.com/?dateRange=all&page=0&prefix=false&query=.fr&sort=byDate&type=story https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu... is probably the best you can do.
- gus_massa 5y agoYou can filter by domain, for example https://news.ycombinator.com/from?site=bbc.co.uk https://news.ycombinator.com/from?site=bbc.co.uk but each TLD/subdomain have a different level of granularity. It would be nice that if https://news.ycombinator.com/from?site=co.uk https://news.ycombinator.com/from?site=co.uk https://news.ycombinator.com/from?site=uk https://news.ycombinator.com/from?site=uk also work and include all the subdomains. Try sending a feature request to the mods hn@ycombinator.com . (They usually reply very soon, but new features may take more time to be implemented, assuming they like them.)