I was hoping that incoming link count for a post in discourse database means no. of times external websites have mentioned that post in their content… But the numbers that I have are too high to believe that.
Could someone please explain what does incoming link count mean?
2 个赞
I believe it is the number of incoming links from the forum itself, that is, the number of other posts that have linked to that post.
There is no rational way to determine how many times external websites have linked to a place without crawling the entire web, like Google.
7 个赞
我查看了代码,发现 incoming_link_count 类似于 “topic_views” 表,只是当请求格式为 json 时,它不会增加 incoming_link_count。
以下是 topics_controller.rb 中相关的几行:
def track_visit_to_topic
topic_id = @topic_view.topic.id
ip = request.remote_ip
user_id = (current_user.id if current_user)
track_visit = should_track_visit_to_topic?
if !request.format.json?
hash = {
referer: request.referer || flash[:referer],
host: request.host,
current_user: current_user,
topic_id: @topic_view.topic.id,
post_number: @topic_view.current_post_number,
username: request['u'],
ip_address: request.remote_ip
}
# 延迟执行此操作,以免将整个控制器捕获到闭包中
TopicsController.defer_add_incoming_link(hash)
end
TopicsController.defer_track_visit(topic_id, ip, user_id, track_visit)
end
我希望这一列能告诉我一个人从外部链接(包括外部搜索引擎)到达该主题的次数,而不是点击内部链接的次数。
1 个赞
同样!如果能看到哪些主题从外部链接访问量最大,那就太好了 ![]()
![]()
![]()