This module integrates with the Saplo Text Analysis API (http://saplo.com/api/), which is an JSON-RPC based Web API that provides text analysis services. By communicating with this API, the module can do tag extraction and similarity evaluation.
Unlike similar modules, this one does not include any sort of infrastructural requirements that have to be installed. The only thing needed is an API-key from Saplo (http://saplo.com/signup/free).
After the module has been properly configured (installation instructions can be found in the README) it adds a button to the node viewing form ("Add Saplo Metadata"); that when pressed connects to the Saplo API, submits the node text for analysis, and receives back data that's saved locally. This data can be tags, other relevant nodes (that have been previously analysed), or both.
Sandbox URL:
http://drupal.org/sandbox/oskarols/1247304
Comments
Comment #1
berkas1 commentedYou have to post link to your sandbox project ;)
Comment #2
oskarols commentedThank you, I've updated the post accordingly.
Comment #3
misc commentedThe applicant has been contacted to ask if the application is abandoned.
Comment #4
misc commented@oskarols answered that this is still active. Should have been switched to need review.
Comment #5
afox commentedHi @oskarols!
Thanks for your submission. I put your module through the PAReview service and it noted quite a lot of small things. Namely coding styles & standards misses and missing documentation. You are also working on a wrong Git branch (no master use, only version branches). Please see the review yourself and clean up what it reports first.
http://ventral.org/pareview/httpgitdrupalorgsandboxoskarols1247304git
I also have couple things below that I noted. I didn't have much time to review this now, but I think you will have your hands full with the coding styles & standards. ;)
I think you need documentation for the module, since there are lots of Saplo-specific things to note. Especially for the API if it's meant for other use outside the module.
saplo.module
$saplo_node = mysqli_fetch_assoc(db_query('SELECT * FROM {saplo_node} WHERE {saplo_node}.nid = %d', $nid));Should be:
$saplo_node = db_fetch_array(db_query('SELECT * FROM {saplo_node} s WHERE s.nid = %d', $nid));db_fetch_array() calls mysql_fetch_array() with MYSQL_ASSOC, which is equivalent to mysql_fetch_assoc(). See http://api.drupal.org/api/drupal/includes--database.mysql.inc/function/d... and http://api.drupal.org/api/drupal/includes--database.mysql.inc/function/d...
- Remove assert() callbacks. They're for debugging only.
saplo.admin.inc
- Move your hook_perm to the main module file. Admin file should contain only admin-area specific code.
- Are there language limitations to use only English and Swedish in the Saplo service? If not, this (and other places in the module) should fetch all the enabled languages with http://api.drupal.org/api/drupal/includes--bootstrap.inc/function/langua...
- You have some descriptions made as form elements. If there's no real reason for this, just use the '#description' parameter. It's also available for fieldsets.
saplo.ui.inc
- The file naming convention for theme functions is saplo.theme.inc.
- You are currently using a template file to present a title and a simple list. This is small enough to be handled by a theme function. I suggest making a theme_saplo_relevance -function and return the list with theme_item_list.
- You can also include the preprocess function content into the theme function.
- hook_theme should exist in the main module file. And since you don't have any other theme functions, move everything else back to the main module file also.
Comment #6
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
Comment #6.0
klausiAdded sandbox URL.