This module can be used to implement a rating system based on external sources. What that means is that the actual rating, voting or whatever action, happens on an external application (for example on Facebook), and the results are fetched into your system. By itself, this module is intended for developers to use it like an API.
- The main advantage of this module is that your system does not handle now the actual rating process. This now happens on external systems.
- You can have many sources from which your rating is fetched. The results will be aggregated from all of them.
- If you have a site with mostly anonymous traffic, it will be very easy for your users to rate content through Facebook or Twitter.
Some key features that this module implements:
- Provides an way of adding resources (usually urls) into a rating queue
- It implements a flexible approach of adding external resources that will handle the rating. This is done using plugins and the ctools module is used for managing these plugins.
- By default, it implements two plugins, one for Facebook and one for Twitter. An example module accompanies the Entity External Rating module and demonstrates how to create a new plugin.
- At cron time, the module will call the external applications to get the voting rating results for the resources that are currently stored in the queue.
Why this name? Although you can add any URL in the queue for rating, they have to be assigned to an entity. This will make future integration with other systems (like Voting API or Views) much easier.
After installing the module, you can go to Structure > Entity external rating and check the module settings, enable or disable the plugins, or change their settings.
A working example can be found here: http://drupaldemos.net/entity_ext_rating. Please note that, by default, the module will not be able to implement what you see on the demo site. That was accomplished using this module as a gateway between the site and the external rating applications. So, at least for the moment, always use the Entity External Rating module in tandem with another, probably custom, module.
For more informations you can check the README file and if you have any questions regarding how to use the module, fell free to contact me.
- Be very careful with the size of the rating queue. Because your custom code will add items to the queue, you have to be sure that it will not grow too much, otherwise the requests at cron time will take too long. When adding items, you can specify for how long should they be valid, as you can check in the README file. The current version of the module does, for to moment, process all the queue. In the next versions there will be probably a more clever approach, but in the same time will not be as "real time" as the current version.
Very important: be very careful with the redirects or the og:url metatag. Make sure the URL you use for sharing is accesible and does not actually redirect to another page, because in this case that page will count. Also, if your page does not make any redirects, make also sure that if you use the og:url metatag, the value is the same as your URL to like (doesn't have to be the URL of the page in all the cases, but it must be the URL used for the like button). Two real examples:
- You have an image gallery or something like a node list, and you don't have a full view of the nodes (everyone who tries to access the full view is redirected to the list), but you want to share them individually. So, the URL to share is the URL for the full view, but this always does a redirect to the list. In this case, you either try to implement a full view of that entity, or, if not possible, you try to make that full view accesible only for the robots (like facebook or twitter).
- You have a full view, but you want to count the shares for the same node every week or month. In this case, you will probably have to put some parameter in the URL to share (for example: node/223?20121). The problem is that if you use the og:url metatag and the setting there is to have only node/node_id in it, the facebook will count actually the node/223 and not node/223?20121, even if the URL that you use to like is node/223?20121. In this case you have to find a way to put that parameter in the og:url metatag (by implementing some custom tokens maybe).