var topsyOtterapi = 'http://otter.topsy.com/trackbacks.js';
function twitterTrackbackList(post)
{
	var tweetHtml = '';

	jQuery.ajax({
		type: 'GET',
		url: topsyOtterapi,
    	cache: false,
		dataType: 'jsonp',
		data: {
			perpage: post.perpage,
			order: 'date',
			url: post.url
		},
		success: function(trackbackData)
		{
			tweetHtml = '';
			if(trackbackData.response.list.length == 0) {
				tweetHtml += ('<p>このページにはまだ Twitter からのトラックバックはありません。</p>');
			} else {
				jQuery.each(trackbackData.response.list, function(n)
				{
					tweetHtml += (
						'<li class="tweet' + n + '">' +
							'<h3><a href="' + this.author.url + '"><img src="' + this.author.photo_url + '" alt="' + this.author.name + '" width="48" /></a><a href="' + this.author.url + '">' + this.author.nick + '</a></h3>' +
							'<div class="content">' + this.content.replace(/((http:|https:)\/\/[\x21-\x7e]+)/gi, "<a href='$1'>$1</a>") + '</div>' +
							'<div class="meta"><ul class="clear"><li><a href="' + this.permalink_url + '">' + this.date_alpha + '</a></li></ul></div>' + 
						'</li>'
					);
				});
			}
			jQuery(post.id).append('<ul class="commentlist">' + tweetHtml + '</ul>');
		},
		complete: function() {
		}
	});
}

