Update to crystal 0.25.1 and send caption.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user