CVS edit link for kathyh

I have written a module that interfaces with a new site called Wordnik. http://www.wordnik.com/about
Wordnik attempts to give as much information about the English language using traditional dictionary but also information from social networking sites, news, images, statistics, audio etc. The information is available through an API.

This can be used with Drupal such as:
-sidebar blocks showing a Word of the Day (useful for teachers)
-center block showing a Word of the Day
-API interface showing word definitions, word uses on the web, word definitions, etc.

I currently have developer's access to the Wordnik API (in alpha). The module blocks to Wordnik Word of the Day have been written. Currently working on the API interface to bring that data into Drupal.

The API will be useful for those that want to track key words in the social networking arena. For example, how is the word 'Drupal' used today? A view could then be displayed which will list twitter feeds, blogs, news etc giving a pulse on the word's use in society today. Also track the frequency, punctuation, other forms etc.

This will provide a rich interface and an interesting splash regarding the words on the site. With the API - I'm sure this can be extended to include taxonomy lookups through Wordnik. That is not planned for this module's release, but would provide the groundwork for that type of work.

CommentFileSizeAuthor
#7 wordnik.zip1.5 KBkathyh
#1 wordnik.zip2.43 KBkathyh

Comments

kathyh’s picture

StatusFileSize
new2.43 KB

Attached is the first revision for the Wordnik module. It contains two block Word of the Day (WOD) modules: Wordnik wordnik_wod_sidebar.module and wordnik_wod.module which can be enabled and displayed in Blocks.

The API place holder is in place, however the content is still under development.

kathyh’s picture

Status: Postponed (maintainer needs more info) » Needs review

Modify status to need review.

kathyh’s picture

Title: kathyh [kathyh] » Wordnik module

Modify issue title.

avpaderno’s picture

Title: Wordnik module » kathyh [kathyh]

Please change only the status, when you upload new code; other metadata are not though to be changed by the applicant.

avpaderno’s picture

Issue tags: +Module review
avpaderno’s picture

Status: Needs review » Needs work

Why did you create two different modules that implement the same block?
A module can implement more than one block. In this case, it is not clear why the users would need two different blocks with just a different title.

/**
* Implementation of wordnik_block
* @param string $op one of "list", "view", "save" and "configure"
* @param integer $delta code to identify the block
* @param array $edit only for "save" operation
**/
function wordnik_wod_sidebar_block($op = 'list', $delta = 0, $edit = array()) { 
   switch ($op) {
     case 'list':
       $blocks[0]['info'] = t('WordNik Word of the Day - Sidebar');
       return $blocks;
     case 'view':
       $block_content .= '<script type="text/javascript" src="http://www.wordnik.com/wordoftheday/codesidebar"></script>';  
       $blocks['subject'] = t('Word of the Day');
       $blocks['content'] = $block_content;
       return $blocks;
   }
 }

/**
* Implementation of wordnik_block
* @param string $op one of "list", "view", "save" and "configure"
* @param integer $delta code to identify the block
* @param array $edit only for "save" operation
**/
function wordnik_wod_block($op = 'list', $delta = 0, $edit = array()) { 
   switch ($op) {
     case 'list':
       $blocks[0]['info'] = t('WordNik Word of the Day');
       return $blocks;
     case 'view':
       $block_content .= '<script type="text/javascript" src="http://www.wordnik.com/wordoftheday/code"></script>';  
       $blocks['subject'] = t('Word of the Day');
       $blocks['content'] = $block_content;
       return $blocks;
   }
 }

As side note, wordnik_wod_block() is an implementation of hook_block(), not wordnik_block().

Comments should be formatted as

/**
 * Implementation of wordnik_block
 * @param string $op one of "list", "view", "save" and "configure"
 * @param integer $delta code to identify the block
 * @param array $edit only for "save" operation
 **/
kathyh’s picture

Status: Needs work » Needs review
StatusFileSize
new1.5 KB

Thank you for your comments. It does make sense that the user would only want one instance of the module. It is now only one module which will display either the small sidebar or the regular widget based on the block setting. Thx again.

Attached is an updated module for review.

avpaderno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)
Issue tags: -Module review

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.