获取 URL 反向链接
我正在尝试创建一个脚本来获取特定网址的反向链接数量 - 我当前使用的方法是查询 google 搜索 API 的 link:example.com/foo/bar
,它返回结果数量 - 我使用该值来估计反向链接。
但是,我正在寻找替代解决方案。
I am trying to create a script to get the amount of backlinks to particular URLs - the method I am currently using is to query the google search API for link:example.com/foo/bar
which returned the amount of results - I used that value to estimate the backlinks.
However, I am looking for alternate solutions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
最基本的方法是在每个传入请求上记录
$_SERVER['HTTP_REFERER']
,这是链接到您网站的网站的 URL。我确信这种方法有一些警告(即不发送 Referer 的条件、可能通过虚假 Referer URL 发送垃圾邮件),但我无法对所有这些警告进行说明。 维基百科页面可能是一个很好的起点。还有 pingback/引用,但我不会依赖它们。
The most basic approach would be to log
$_SERVER['HTTP_REFERER']
on every incoming request, which is the URL of the site linking to your site. I'm sure there are some caveats to this approach (i.e. conditions under which Referer is not sent, potential for being spammed through bogus Referer URLs), but I can't speak to all of them. The Wikipedia page may be a good starting point.There are also pingbacks/trackbacks, but I wouldn't rely on them.
Pingbacks / Trackbacks 用于确定来自特定网站的点击次数。这些是手动的,而不是自动的,并且当它们命中时才有意义。
然而,您到目前为止所做的方法涉及大量链接和反向链接缓存。
要么必须有某种数据库来跟踪两个页面之间的连接节点,要么您必须开始构建自己的数据库。
使用可用的数据库,并更好地构建多个数据库的混搭。但是,如果您想构建强大的系统,请验证系统的反向链接,然后也在您的端维护缓存。缓存应仅包含经过验证的反向链接。
我希望这能起作用。
Pingbacks / Trackbacks are to determine hits from a particular website. These are manual, rather than automatic, and are meaningful when there is a HIT from them.
However, the approach you did till now, is something that involves a huge cache of links and backlinks.
Either there must be some kind of database to track the nodes of connection between two pages, or you must start builiding your own.
Use the available ones, and better build a mashup of more than one database. But, if you want to have strong system built, then verify the backlink from your system, and then maintain the cache at your end too. The cache should include the verified backlinks only.
I hope this works.
我认为 http://www.opensiteexplorer.org/ 和他们的 api 可能会有更多帮助。
I think http://www.opensiteexplorer.org/ and their api might be of more help.