Hacker News new | past | comments | ask | show | jobs | submit login

Also, what is this jqmusic executable with the jq style query?



Just a jq wrapper that adds -e and includes some functions

  $ cat ~/bin/jqmusic
  #!/usr/bin/env bash
  
  exec jq -e "${@:1:$(($#-2))}" "include \"music\"; ${@: -2:1}" "${@: -1}" >/dev/null 2>&1
  $ cat ~/.jq/music.jq
  def year: .released | match("[0-9]{4}").string | tonumber;
  def has_genre(str): .genres.primary | any(. == str);
  def match_genre(regexp): .genres.primary | any(match(regexp));
Together with https://git.sr.ht/~q3cpma/rymscrap to get the actual JSON.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: