It would be great to add a service to VotingAPI that will return the computed rating and count in a consistent way. Each module computes values differently, of course, but if there were some predictable methods that they had to implement, it would be a great feature. Ideally it would return a value for:
- Rating
- Count of ratings
- Minimum rating
- Maximum rating
I am coming here from the Schema Metatag β module, where we are trying to create JSON-LD metatags that can be used to display voting results to Google and other bots. These ratings make it possible to get your content featured in searches. We need to be able to display 'rating', 'count', 'minimum value', and 'maximum value' in the meta tags.
Ideally there would be tokens available, but there aren't. I have been digging into D8 modules that implement voting api and there is no consistency or pattern to how they compute the votes. That's the point of an API of course, and I know the original intention here was to just standardize storage. But standardizing a way of return those basic values would also make sense. It could be used to render tokens and to create metatags and structured data. And it would also make it easier to disseminate ratings as a component of entity data to other apps or sites in REST requests.
The issue where we are wrestling with this is here β .
Active
4.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.