mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Limit number of reddit comments
This commit is contained in:
parent
caf82ccb8f
commit
d9c89f7e3f
2 changed files with 4 additions and 4 deletions
|
@ -262,7 +262,7 @@ def get_reddit_comments(id, client, headers)
|
|||
search_results = RedditSubmit.from_json(search_results.body)
|
||||
|
||||
thread = search_results.data.children.sort_by { |child| child.data.score }[-1]
|
||||
result = client.get("/r/#{thread.data.subreddit}/comments/#{thread.data.id}?sort=top&depth=3", headers).body
|
||||
result = client.get("/r/#{thread.data.subreddit}/comments/#{thread.data.id}?limit=100&sort=top", headers).body
|
||||
result = JSON.parse(result)
|
||||
elsif search_results.status_code == 302
|
||||
search_results = client.get(search_results.headers["Location"], headers).body
|
||||
|
|
|
@ -109,7 +109,7 @@ function toggle(target) {
|
|||
<div style="margin-right:1em; overflow-wrap:break-word; word-wrap:break-word;">
|
||||
<h3><%= reddit_thread.data.title %></h3>
|
||||
<b>
|
||||
<a target="_blank" href="https://reddit.com<%= reddit_thread.data.permalink %>">View comments on Reddit</a>
|
||||
<a target="_blank" href="https://reddit.com<%= reddit_thread.data.permalink %>">View more comments on Reddit</a>
|
||||
</b>
|
||||
<%= reddit_html %>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue