We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hn.nim throws a KeyError exception when comments are disabled.
It works if you replace:
characters $call.json["descendants"].getInt() & " comments"
With:
try: characters $call.json["descendants"].getInt() & " comments" except KeyError: characters "comments disabled"
The HN website just says "3 hours ago | hide" so it isn't a perfect match.
Here's the JSON for a HN post with comments disabled:
{ "by": "thomaspaulmann", "id": 25217586, "score": 1, "time": 1606374063, "title": "Raycast (YC W20) Is Hiring Fullstack Software Engineers (EU, Remote)", "type": "job", "url": "https://raycast.com/jobs/software-engineer-fullstack" }
The text was updated successfully, but these errors were encountered:
Similar issue, solved with a similar fix:
try: let uri = parseUri(call.json["url"].getStr()) characters "(" & uri.hostname & ")" except KeyError: characters ""
Sorry, something went wrong.
Thanks, ill fix it!
Fixed: e67ff45
No branches or pull requests
hn.nim throws a KeyError exception when comments are disabled.
It works if you replace:
With:
The HN website just says "3 hours ago | hide" so it isn't a perfect match.
Here's the JSON for a HN post with comments disabled:
The text was updated successfully, but these errors were encountered: