简体   繁体   English

通过 API 获取 WordPress.org 评论

[英]Fetching WordPress.org reviews via API

I want to fetch a plugin review from wordpress.org via API, is it possible?我想通过 API 从 wordpress.org 获取插件评论,可以吗? I tried using https://api.wordpress.org/plugins/info/1.0/{slug}.json but no luck?我尝试使用https://api.wordpress.org/plugins/info/1.0/{slug}.json但运气不好? Is there anyone available for help?有没有人可以提供帮助?

To fetch reviews of a WordPress plugin from the WordPress plugin directory, you can use the WordPress.org Plugin API. The API allows you to retrieve information about a plugin, including its reviews, by sending a GET request to a specific endpoint.要从 WordPress 插件目录中获取 WordPress 插件的评论,您可以使用 WordPress.org 插件 API。API 允许您通过向特定端点发送 GET 请求来检索有关插件的信息,包括其评论。

Here's an example of how you can use the API to retrieve reviews for a plugin with the slug "akismet":下面是一个示例,说明如何使用 API 检索带有 slug“akismet”的插件的评论:

https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slug]=akismet

This will return JSON data containing information about the plugin, including an array of reviews.这将返回 JSON 数据,其中包含有关插件的信息,包括一组评论。 You can then parse the JSON data and extract the reviews as needed.然后,您可以解析 JSON 数据并根据需要提取评论。 At this moment it only returns 10 reviews.目前它只返回 10 条评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM