Skip to content
This repository has been archived by the owner on Mar 5, 2019. It is now read-only.

Commit

Permalink
Pay attention to lack of authorization failures
Browse files Browse the repository at this point in the history
  • Loading branch information
willhoney7 committed Sep 5, 2011
1 parent f7c8941 commit 9f8c26a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

## Javascript Google Reader Library ##

Here is an unofficial JS Google Reader Library. Licensed GPLv3.
Expand Down
13 changes: 9 additions & 4 deletions google-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This library requires the underscore library found at http://documentcloud.github.com/underscore/
This library requires the underscore string library found at http://edtsech.github.com/underscore.string/
This library requires the support of localStorage. Updates could be easily made to change that
This library requires the support of localStorage. Updates could be easily made to change that.
*/

/* jslint adsafe: false, devel: true, regexp: true, browser: true, vars: true, nomen: true, maxerr: 50, indent: 4 */
Expand Down Expand Up @@ -169,6 +169,12 @@
}
}
}
if(request.status === 401 && request.statusText === "Unauthorized"){
//Humane is a notification lib.
if(humane){
humane(request.statusText + ". " + "Try logging in again.");
}
}

console.error(request);
}
Expand All @@ -194,7 +200,6 @@
reader.is_logged_in = true;
}
return (reader.is_logged_in);

};

reader.login = function (email, password, successCallback, failCallback) {
Expand Down Expand Up @@ -636,10 +641,10 @@
}, successCallback);
};

var urlRegex = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?\^=%&:\/~\+#]*[\w\-\@?\^=%&\/~\+#])?/;
var readerUrlRegex = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?\^=%&:\/~\+#]*[\w\-\@?\^=%&\/~\+#])?/;
reader.processFeedInput = function (input, inputType, successCallback, failCallback) {
var url = "https://ajax.googleapis.com/ajax/services/feed/";
if ((reader.urlRegex.test(input) || inputType === "url") && inputType !== "keyword") {
if ((readerUrlRegex.test(input) || inputType === "url") && inputType !== "keyword") {
url += "load";
} else {
url += "find";
Expand Down

0 comments on commit 9f8c26a

Please sign in to comment.