tombloo local

quote をはてブにもクロスポストするようにしてるけど、文字数制限があるので、ローカルにも落とすようにした。でもちょっとフォーマットを変えたい。追加日時も入れたい。

crome/content/library/20_model.js

models.register({
	name : 'Local',
	ICON : 'chrome://tombloo/skin/local.ico',
	
	check : function(ps){
		return (/(regular|photo|quote|link)/).test(ps.type);
	},
	
	post : function(ps){
		if(ps.type=='photo'){
			return this.Photo.post(ps);
		} else {
			return Local.append(getDataDir(ps.type + '.txt'), ps);
		}
	},
	
	append : function(file, ps){
		putContents(file, joinText([
			joinText([joinText(ps.tags, ' '), ps.item, ps.itemUrl, ps.body, ps.description], '\n\n', true), 
			getContents(file)
		], '\n\n\n'));
		
		return succeed();
	},

ここらへんをいじればよさそう。