Update to crystal 0.25.1 and send caption.

This commit is contained in:
2018-07-17 21:41:15 -07:00
parent 263db178a7
commit 1c6625400a
2 changed files with 11 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ end
def filter_reddit_json(json, completed)
json["data"]["children"]
.as_a
.map(&.["data"])
.select do |it|
url = it["url"].as_s
@@ -22,5 +23,5 @@ end
def get_reddit_post(subreddit, completed)
json = get_reddit_json(subreddit)
post = json.try { |json| filter_reddit_json(json, completed).first? }
post.try { |post| completed.push(post["name"].as_s); post["url"].as_s }
post.try { |post| completed.push(post["name"].as_s); { post["url"].as_s, post["title"].as_s } }
end