loop over search queries from stdin