The interface for Algolia search is horrible for picking date ranges so I made this little bash function to fix it (noting that "open" is an alias to "xdg-open" for me on Linux).<p>Might work in other shells too.<p><pre><code> function hn() {
if test $# -lt 1 || test $# -gt 3; then
echo "Usage: $0 <query> [start=1970] [end=now]"
echo "start and end are ISO dates like 2014-03-23."
return 1
fi
query=$1
start=$(test $# -gt 1 && date --date "$2" +%s || date --date @0 +%s)
end=$(test $# -gt 2 && date --date "$3" +%s || date +%s)
url="https://hn.algolia.com/?sort=byPopularity&prefix=false&page=0&type=story&query=${query}&dateRange=custom&dateStart=${start}&dateEnd=${end}"
echo $url
open "$url"
}</code></pre>
Indeed, we never took the time to plug a date parser. Any chance you've time for a pull-request? <a href="https://github.com/algolia/hn-search/blob/master/app/assets/javascripts/controllers.js#L26" rel="nofollow">https://github.com/algolia/hn-search/blob/master/app/assets/...</a> and <a href="https://github.com/algolia/hn-search/blob/master/app/controllers/api/v1/base_controller.rb#L7" rel="nofollow">https://github.com/algolia/hn-search/blob/master/app/control...</a> :)<p>That would be cool!