Permalink
Browse files

Fix pingback titles

  • Loading branch information...
1 parent 452d7e3 commit cd1a23f8ed0662116e3a1dcfc2db43edfcedeaf4 @pvorb committed Mar 8, 2012
Showing with 14 additions and 11 deletions.
  1. +1 −1 comments.js
  2. +3 −0 test/hello.html
  3. +10 −10 test/list.js
View
@@ -385,7 +385,7 @@ Comments.prototype.handlePingback
// save the pingback as a comment
self.saveComment(target.pathname, {
message: '[…] '+ping.excerpt+' […]',
- author: source.title,
+ author: ping.title,
website: source.href,
pingback: true
}, function (err) {
View
@@ -8,6 +8,9 @@ <h1>Hallo Welt</h1>
<p>I hope you like it.</p>
<p>A little more context <a href="http://127.0.0.1:1338/world.html">World</a>,
please.</p>
+ <p>An a link to <a
+ href="http://localhost/log/2012/02/node-and-npm-on-debian.html">Node and
+ Debian</a>.
<p>End of test, look how much has been added to the comment.</p>
</body>
View
@@ -3,17 +3,17 @@ var Comments = require('../');
var comments = new Comments();
// list all comments
-comments.getComments('/log/2011/09/test.html', function(err, results) {
- results.each(function(err, comment) {
+comments.getComments('/log/2011/09/test.html',
+ {}, { limit: 2, sort: [[ "modified", "desc" ]] },
+ function(err, results) {
+ results.toArray(function(err, c) {
if (err) throw err;
- if (comment)
- console.log(comment);
- else
- comments.close(function(err) {
- if (err) throw err;
-
- console.log('bye');
- });
+ c = c.reverse();
+ c.forEach(function (c) { console.log(c); });
+ comments.close(function(err) {
+ if (err) throw err;
+ console.log('bye');
+ });
});
});

0 comments on commit cd1a23f

Please sign in to comment.