From 1b4d7961dff6d7abca01ded1f395f948917940d8 Mon Sep 17 00:00:00 2001 From: tyru Date: Tue, 3 May 2011 16:52:57 +0900 Subject: show clear message when a user needs to authenticate. --- subscldr.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'subscldr.js') diff --git a/subscldr.js b/subscldr.js index 2c2805c..83a039c 100644 --- a/subscldr.js +++ b/subscldr.js @@ -131,6 +131,7 @@ liberator.plugins.subscldr = (function() { req.addEventListener("onSuccess", function(res) { liberator.log(res.responseText); res.getHTMLDocument(); + if (isLoginForm(res.doc)) throw "Please login to LDR to subscribe the feed."; subscribeInfo = getSubscribeInfo(res.doc); liberator.log(subscribeInfo.toSource()); }); @@ -191,6 +192,11 @@ liberator.plugins.subscldr = (function() { } + function isLoginForm(htmldoc) { + return htmldoc.getElementById('livedoor_id') && + htmldoc.getElementById('password'); + } + function getSubscribeInfo(htmldoc) { var subscribeInfo = { target_url: null, -- cgit v1.2.3 From 6974c188200faec5160d63d3fa3684b3116892de Mon Sep 17 00:00:00 2001 From: tyru Date: Tue, 3 May 2011 16:53:24 +0900 Subject: fix english --- subscldr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subscldr.js') diff --git a/subscldr.js b/subscldr.js index 83a039c..7d8bfad 100644 --- a/subscldr.js +++ b/subscldr.js @@ -226,7 +226,7 @@ liberator.plugins.subscldr = (function() { function selectFeed(links, next) { liberator.log(links.toSource()); - liberator.echo("Following feeds were found on this site. Which are you subscribe?"); + liberator.echo("Following feeds were found on this site. Which do you subscribe?"); commandline.input("Select or input feed URL ", function(selected) { liberator.echo("You select " + selected + "."); commandline.close(); -- cgit v1.2.3