Reddit上,如何让剧本和upvotes为downvotes注释的数量? [英] On Reddit, how do scripts get the number of upvotes and downvotes for a comment?

查看:348
本文介绍了Reddit上,如何让剧本和upvotes为downvotes注释的数量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

reddit的,人们可以张贴得到upvotes和downvotes意见。此信息不是页面本身容易获得,所以它似乎像一个API来收集这些信息。

On Reddit, people can post comments that get upvotes and downvotes. This information is not readily accessible on the page itself, so it seems that something like an API is used to gather this information.

我发现这个剧本,这是否的,但我无法确定在脚本的地方从拉动这一信息。可能有人点我到相关行,其中的脚本获取数据?

I found this script that does this, but am unable to determine where in the script it pulls this information from. Could someone point me to the relevant line where the script gets the data from?

推荐答案

每个评论都有数据属性:

<div class="thing id-t1_c4upmtm odd comment " onclick="click_thing(this)" data-fullname="t1_c4upmtm" data-ups="646" data-downs="83">

reddit的的HTML结构真的很难遵循这样想出一个办法在征求意见的ID,其中包含这个东西的元素就搞定了。

Reddit's HTML structure is really hard to follow so figure out a way to get from the comment ID to the element which contains this stuff.

这篇关于Reddit上,如何让剧本和upvotes为downvotes注释的数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆