Coder Social home page Coder Social logo

Comments (8)

imaegoo avatar imaegoo commented on August 15, 2024

暂时还没有这个功能

可以实现,未来会做

from twikoo.

heson525 avatar heson525 commented on August 15, 2024

同等。

from twikoo.

imaegoo avatar imaegoo commented on August 15, 2024

@jerryc127 @heson525

需要获得最新评论的哪些信息?可以做成接口,设计如下:

Get comments count(设计,请以最终文档为准)

批量获取文章评论数。

Version

>= 0.2.7

Example

twikoo.getCommentsCount({
  envId: 'imaegoo-16fe3d', // 环境 ID
  urls: [ // 不包含协议和域名的文章路径列表,必传参数
    '/2020/10/post-1.html',
    '/2020/11/post-2.html',
    '/2020/12/post-3.html'
  ],
  includeReply: false // 评论数是否包括回复,默认:false
}).then(function (res) {
  console.log(res)
  // 返回示例: [
  //   { url: '/2020/10/post-1.html', count: 10 },
  //   { url: '/2020/11/post-2.html', count: 0 },
  //   { url: '/2020/12/post-3.html', count: 20 }
  // ]
});

Get newest comments(设计,请以最终文档为准)

获取最新评论。

Version

>= 0.2.7

Example

twikoo.getNewestComments({
  envId: 'imaegoo-16fe3d', // 环境 ID
  pageSize: 10, // 获取多少条,默认:10
  includeReply: false // 是否包括最新回复,默认:false
}).then(function (res) {
  console.log(res)
  // 返回 Array,包含最新评论的
  //   * url          评论地址
  //   * nick:        昵称
  //   * mailMd5:     邮箱的 MD5 值,可用于展示头像
  //   * link:        网址
  //   * comment:     HTML 格式的评论内容
  //   * commentText: 纯文本格式的评论内容
  //   * created:     评论时间,格式为毫秒级时间戳
  // 返回示例: [ // 从新到旧顺序
  //   { url: '', nick: '', mailMd5: '', link: '', comment: '', commentText: '', created: 0 },
  //   { url: '', nick: '', mailMd5: '', link: '', comment: '', commentText: '', created: 0 },
  //   { url: '', nick: '', mailMd5: '', link: '', comment: '', commentText: '', created: 0 }
  // ]
});

修改:getNewestComments response增加了评论地址

from twikoo.

jerryc127 avatar jerryc127 commented on August 15, 2024

為開發者點贊。。

嗯嗯 一般都只需要這幾個參數
頭像/昵稱/評論内容/評論所在網址/評論時間 這幾個

(還有,騰訊雲對於這些調用api 有次數限制麽?)

from twikoo.

heson525 avatar heson525 commented on August 15, 2024

太强了😀,这些数据够用了。0.2.7什么时候推上去?

from twikoo.

imaegoo avatar imaegoo commented on August 15, 2024

@jerryc127

(還有,騰訊雲對於這些調用api 有次數限制麽?)

有限制,但是不是次数限制,而是资源使用量限制。免费版资源使用量限制为 40000 GBs/月。

资源使用量计算公式为:内存使用量(GB) * 执行时间(秒)

twikoo 单次调用的资源使用量在0.01~0.05不等,平均大概在0.02,相当于每月免费调用200万次左右,由于资源使用量每次调用不稳定,估算仅供参考。


更新:无法达到200万次/月,因为数据库存在 50000 次/天 的调用限制

from twikoo.

imaegoo avatar imaegoo commented on August 15, 2024

太强了😀,这些数据够用了。0.2.7什么时候推上去?

@heson525 约7日内

from twikoo.

imaegoo avatar imaegoo commented on August 15, 2024

文档:https://twikoo.js.org/api.html

from twikoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.