diff -Naur compare/before/services/services/comment_service/comment_service.info compare/after/services/services/comment_service/comment_service.info
--- compare/before/services/services/comment_service/comment_service.info
1969-12-31 16:00:00.000000000 -0800
+++ compare/after/services/services/comment_service/comment_service.info
2007-08-26 02:27:00.000000000 -0700
@@ -0,0 +1,7 @@
+name = Comment Service
+description = Provides a comment service.
+package = Services - services
+dependencies = services comment
+version = "5.x-1.x-dev"
+project = "services"
+
diff -Naur compare/before/services/services/comment_service/comment_service.module compare/after/services/services/comment_service/comment_service.module
--- compare/before/services/services/comment_service/comment_service.module
1969-12-31 16:00:00.000000000 -0800
+++ compare/after/services/services/comment_service/comment_service.module
2007-10-08 13:51:01.812500000 -0700
@@ -0,0 +1,211 @@
+<?php
+
+/**
+ * Implementation of hook_help().
+ */
+function comment_service_help($section) {
+  switch ($section) {
+    case 'admin/help#services_comment':
+      return t('<p>Provides comment methods to services applications. Requires services.module.</p>');
+    case 'admin/modules#description':
+      return t('Provides comment methods to services applications. Requires services.module.');
+  }
+}
+
+/**
+ * Implementation of hook_service()
+ */
+function comment_service_service() {
+  return array(
+
+               // comment.saveComment method definition
+               array (
+                       '#method' => 'comment.saveComment',
+                       '#callback' => 'comment_service_saveComment',
+                       '#args' =>      array(
+                                                       array(  '#name' => 'comment',
+                                                                       '#type'=> 'array',
+                                                                       '#optional' => FALSE,
+                                                                       '#description' => 'An array representing a comment'
+                                                       )
+                                               ),
+                       '#return'=> 'int',
+                       '#help' => 'This method adds a comment to a node and returns a comment id.  If a nonzero cid is specified in the comment array, then the comment with that cid is edited. Required fields: nid, comment. Optional fields: cid (comment id), pid (parent comment), subject, mail, homepage'
+               ),
+
+               // comment.getNodeComments method definition
+               array (
+                       '#method' => 'comment.getNodeComments',
+                       '#callback' => 'comment_service_getNodeComments',
+                       '#args' =>      array(
+                                                       array(  '#name' => 'nid',
+                                                                       '#type'=> 'int',
+                                                                       '#optional' => false,
+                                                                       '#description' => 'the node id'
+                                                       ),
+                                                       array(  '#name' => 'fields',
+                                                                       '#type'=> 'array',
+                                                                       '#optional' => TRUE,
+                                                                       '#description' => 'A list of fields to return.'
+                                                       )
+                                               ),
+                       '#return'=> 'array',
+                       '#help' => 'This method returns all of the comments on a given node.'
+               ),
+
+               // comment.getNodeCommentCount method definition
+               array (
+                       '#method' => 'comment.getNodeCommentCount',
+                       '#callback' => 'comment_service_getNodeCommentCount',
+                       '#args' =>      array(
+                                                       array(  '#name' => 'nid',
+                                                                       '#type'=> 'int',
+                                                                       '#optional' => false,
+                                                                       '#description' => 'the node id'
+                                                       )
+                                               ),
+                       '#return'=> 'int',
+                       '#help' => 'This method returns the number of comments on a given node.'
+               ),
+
+               // comment.getNodeNewCommentCount method definition
+               array (
+                       '#method' => 'comment.getNodeNewCommentCount',
+                       '#callback' => 'comment_service_getNodeNewCommentCount',
+                       '#args' =>      array(
+                                                       array(  '#name' => 'nid',
+                                                                       '#type'=> 'int',
+                                                                       '#optional' => false,
+                                                                       '#description' => 'the node id'
+                                                       ),
+                                                       array(  '#name' => 'timestamp',
+                                                                       '#type'=> 'int',
+                                                                       '#optional' => true,
+                                                                       '#description' => 'time to count from (defaults to time of last user acces to node)'
+                                                       )
+                                               ),
+                       '#return'=> 'int',
+                       '#help' => 'This method returns the number of new comments on a given node since a given timestamp.'
+               ),
+
+               // comment.getMostCommentedNodes method definition
+               array (
+                       '#method' => 'comment.getMostCommentedNodes',
+                       '#callback' => 'comment_service_getMostCommentedNodes',
+                       '#args' =>      array(
+                                                       array(  '#name' => 'limit',
+                                                                       '#type'=> 'int',
+                                                                       '#optional' => true,
+                                                                       '#description' => 'A limit on the number of nodes to return.  Default is 10 if not specified'
+                                                       )
+                                               ),
+                       '#return'=> 'array',
+                       '#help' => 'This method returns statistics on the nodes with the most comments.'
+               )
+
+  );
+}
+
+/**
+ * Adds a new comment to a node and returns the cid.
+ * If a cid is specified in $comment->cid then that comment is edited.
+ */
+function comment_service_saveComment($comment){
+       global $user;
+
+       if(isset($comment['cid']) && ($comment['cid'] != 0)){
+               // user is trying to edit a comment
+               $initialComment = _comment_load($comment['cid']);
+               $admin = user_access("administer comments");
+
+               if(($initialComment->uid == 0) && !$admin){
+                       return services_error(t("Anonymous comments can't be edited"));
+               }
+
+               if(($initialComment->uid != $user->uid) && !$admin){
+                       return services_error(t("User does not have permission to edit this comment"));
+               }
+       }
+
+       $comment['format'] = 1; // force the input filter to be 1 (the "Filtered HTML" input format)
+       $comment['uid'] = $user->uid;
+       $comment['name'] = $user->name;
+       $comment['timestamp'] = time();
+
+       return comment_save($comment);
+}
+
+/**
+ * Returns the comments of a specified node.
+ */
+function comment_service_getNodeComments($nid, $fields = array()){
+
+       if (!is_numeric($nid)){
+               return services_error(t("Invalid nid"));
+       }
+
+       $result = db_query("SELECT * FROM {comments} c, {users} u WHERE u.uid = c.uid AND nid = '$nid' ORDER BY thread DESC");
+       $comments = array();
+
+       while ($comment = db_fetch_object($result)){
+
+               $temp = NULL;
+
+               // loop through and get only requested fields
+               if (count($fields) > 0) {
+                       foreach ($fields as $field) {
+                               $temp->{$field} = $comment->{$field};
+                       }
+               } else {
+                       $temp = $comment;
+               }
+               $comments[] = $temp;
+       }
+
+       return $comments;
+}
+
+/**
+ * Returns the number of comments on a given node id
+ */
+function comment_service_getNodeCommentCount($nid){
+
+       if(!is_numeric($nid)){
+               return services_error(t("Invalid nid"));
+       }
+
+       return comment_num_all($nid);
+
+}
+
+/**
+ * Returns the number of new comments on a given node id since timestamp
+ */
+function comment_service_getNodeNewCommentCount($nid, $timestamp = 0){
+
+       if(!is_numeric($nid) || !is_numeric($timestamp)){
+               return services_error(t("Invalid input"));
+       }
+
+       return comment_num_new($nid, $timestamp);
+}
+
+/**
+ * Returns information about the most commented nodes.
+ */
+function comment_service_getMostCommentedNodes($limit = 10){
+
+       $rows = array();
+
+       if (!is_numeric($limit)){
+               return services_error(t("Invalid limit"));
+       }
+
+       $result = db_query_range("SELECT * FROM {node_comment_statistics} ORDER BY comment_count DESC $limitString", 0, $limit);
+
+       while($row = db_fetch_object($result)){
+               $rows[] = $row;
+       }
+
+       return $rows;
+}