thomblr

convrt yr tumblr <3 to bookmrks
git clone https://wehaveforgeathome.hates.computer/thomblr.git
Log | Files | Refs | LICENSE

commit 09f7070cfb932f519b6c7fe9d8a4ce943c1dc388
parent f10578be8332c3e5abed9e39c9be92b34330c00c
Author: Ryan Wolf <rwolf@borderstylo.com>
Date:   Wed, 23 Mar 2011 16:32:01 +0000

quotes, conversations

Diffstat:
Mserver.js | 15++++++++++++++-
Mtumblr.js | 6+++++-
2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/server.js b/server.js @@ -70,11 +70,24 @@ router.get('thoms/likes', function (request, response) { }); parser.addListener('end', function(result) { response.writeHead(200); + + + var header = [ + '<!DOCTYPE NETSCAPE-Bookmark-file-1>', + '<!-- This is an automatically generated file.', + ' It will be read and overwritten.', + ' DO NOT EDIT! -->', + '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">', + '<TITLE>Bookmarks</TITLE>', + '<H1>Bookmarks</H1>', + '<DL><p>', + ]; + response.write(header.join('\n') + '\n'); if (!result.posts.post) { return response.end(''); } result.posts.post.forEach(function (post) { response.write(tumblr.serialize(post) + '\n'); }); - response.end(); + response.end('</DL><p>\n'); }); }); crequest.end(); diff --git a/tumblr.js b/tumblr.js @@ -23,7 +23,7 @@ var video = function (post) { return (link.indexOf('http') == 0) ? link : regular(post); }; -exports.serialize = function (post) { +var getUrl = function (post) { switch (post['@'].type) { case 'link': return link(post); @@ -34,3 +34,7 @@ exports.serialize = function (post) { } return regular(post); }; + +exports.serialize = function (post) { + return sys.inspect(post); +};