Skip to content

Commit

Permalink
error handling update
Browse files Browse the repository at this point in the history
  • Loading branch information
colarusso committed Aug 6, 2024
1 parent d57db8b commit 68e7aa2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
36 changes: 19 additions & 17 deletions js/feeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ var papers_feeds = [
"https://rss.nytimes.com/services/xml/rss/nyt/sunday-review.xml",
"https://www.washingtonpost.com/arcio/rss/category/politics/?itid=lk_inline_manual_2",
"https://www.washingtonpost.com/arcio/rss/category/opinions/?itid=lk_inline_manual_7",
"http://feeds.washingtonpost.com/rss/sports?itid=lk_inline_manual_20",
//"http://feeds.washingtonpost.com/rss/sports?itid=lk_inline_manual_20",
"http://feeds.washingtonpost.com/rss/business/technology?itid=lk_inline_manual_31",
"http://feeds.washingtonpost.com/rss/national?itid=lk_inline_manual_32",
"http://feeds.washingtonpost.com/rss/world?itid=lk_inline_manual_36",
"http://feeds.washingtonpost.com/rss/business?itid=lk_inline_manual_37",
"http://feeds.washingtonpost.com/rss/lifestyle?itid=lk_inline_manual_38",
//"http://feeds.washingtonpost.com/rss/lifestyle?itid=lk_inline_manual_38",
"http://feeds.washingtonpost.com/rss/entertainment?itid=lk_inline_manual_39",
"https://feeds.a.dj.com/rss/RSSOpinion.xml",
"https://feeds.a.dj.com/rss/RSSWorldNews.xml",
Expand Down Expand Up @@ -76,12 +76,13 @@ var papers_feeds = [
]

var condenast_feeds = [
"http://www.newyorker.com/feed/news",
"http://www.newyorker.com/feed/culture",
"http://www.newyorker.com/feed/humor",
//"http://www.newyorker.com/feed/news",
//"http://www.newyorker.com/feed/culture",
//"http://www.newyorker.com/feed/humor",
//"http://www.newyorker.com/feed/tag/books/rss",
"http://www.newyorker.com/feed/tech",
"http://www.newyorker.com/feed/news/sporting-scene",
//"http://www.newyorker.com/feed/tech",
//"http://www.newyorker.com/feed/news/sporting-scene",
"https://www.newyorker.com/feed/magazine/rss",
"https://www.vanityfair.com/feed/rss",
"https://feeds.arstechnica.com/arstechnica/technology-lab",
"https://feeds.arstechnica.com/arstechnica/tech-policy",
Expand All @@ -97,12 +98,13 @@ var condenast_feeds = [
]

var magazine_feeds = [
"http://www.newyorker.com/feed/news",
"http://www.newyorker.com/feed/culture",
"http://www.newyorker.com/feed/humor",
//"http://www.newyorker.com/feed/news",
//"http://www.newyorker.com/feed/culture",
//"http://www.newyorker.com/feed/humor",
//"http://www.newyorker.com/feed/tag/books/rss",
"http://www.newyorker.com/feed/tech",
"http://www.newyorker.com/feed/news/sporting-scene",
//"http://www.newyorker.com/feed/tech",
//"http://www.newyorker.com/feed/news/sporting-scene",
"https://www.newyorker.com/feed/magazine/rss",
"https://www.vanityfair.com/feed/rss",
"https://www.economist.com/the-world-this-week/rss.xml",
"https://www.economist.com/letters/rss.xml",
Expand Down Expand Up @@ -916,12 +918,12 @@ var suffolk_law_feeds = [
"https://rss.nytimes.com/services/xml/rss/nyt/sunday-review.xml",
"https://www.washingtonpost.com/arcio/rss/category/politics/?itid=lk_inline_manual_2",
"https://www.washingtonpost.com/arcio/rss/category/opinions/?itid=lk_inline_manual_7",
"http://feeds.washingtonpost.com/rss/sports?itid=lk_inline_manual_20",
//"http://feeds.washingtonpost.com/rss/sports?itid=lk_inline_manual_20",
"http://feeds.washingtonpost.com/rss/business/technology?itid=lk_inline_manual_31",
"http://feeds.washingtonpost.com/rss/national?itid=lk_inline_manual_32",
"http://feeds.washingtonpost.com/rss/world?itid=lk_inline_manual_36",
"http://feeds.washingtonpost.com/rss/business?itid=lk_inline_manual_37",
"http://feeds.washingtonpost.com/rss/lifestyle?itid=lk_inline_manual_38",
//"http://feeds.washingtonpost.com/rss/lifestyle?itid=lk_inline_manual_38",
"http://feeds.washingtonpost.com/rss/entertainment?itid=lk_inline_manual_39",
"https://feeds.a.dj.com/rss/RSSOpinion.xml",
"https://feeds.a.dj.com/rss/RSSWorldNews.xml",
Expand Down Expand Up @@ -1035,12 +1037,12 @@ var feeds_long_list = [
// Washington Post
"https://www.washingtonpost.com/arcio/rss/category/politics/?itid=lk_inline_manual_2",
"https://www.washingtonpost.com/arcio/rss/category/opinions/?itid=lk_inline_manual_7",
"http://feeds.washingtonpost.com/rss/sports?itid=lk_inline_manual_20",
//"http://feeds.washingtonpost.com/rss/sports?itid=lk_inline_manual_20",
"http://feeds.washingtonpost.com/rss/business/technology?itid=lk_inline_manual_31",
"http://feeds.washingtonpost.com/rss/national?itid=lk_inline_manual_32",
"http://feeds.washingtonpost.com/rss/world?itid=lk_inline_manual_36",
"http://feeds.washingtonpost.com/rss/business?itid=lk_inline_manual_37",
"http://feeds.washingtonpost.com/rss/lifestyle?itid=lk_inline_manual_38",
//"http://feeds.washingtonpost.com/rss/lifestyle?itid=lk_inline_manual_38",
"http://feeds.washingtonpost.com/rss/entertainment?itid=lk_inline_manual_39",
// The Economist
"https://www.economist.com/the-world-this-week/rss.xml",
Expand Down Expand Up @@ -1308,7 +1310,7 @@ test_feeds = [
"http://feeds.washingtonpost.com/rss/national?itid=lk_inline_manual_32",
"http://feeds.washingtonpost.com/rss/world?itid=lk_inline_manual_36",
"http://feeds.washingtonpost.com/rss/business?itid=lk_inline_manual_37",
"http://feeds.washingtonpost.com/rss/lifestyle?itid=lk_inline_manual_38",
//"http://feeds.washingtonpost.com/rss/lifestyle?itid=lk_inline_manual_38",
"http://feeds.washingtonpost.com/rss/entertainment?itid=lk_inline_manual_39",
// The Economist
"https://www.economist.com/the-world-this-week/rss.xml",
Expand Down
34 changes: 16 additions & 18 deletions js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,28 +1140,26 @@ function declutter(title_source,id_source,tf_source,n=0){
const errorMessage = `Error fetching RSS feed: ${error.message}`;
if (errors==0) {
displayErrorPopup(feedTitle, feedUrl, errorMessage);
setTimeout(function(){
crunch_numbers = true;
dedup_articles();
reorderArticles();
displayArticles();
updateItemCount();
displayed_cards = newsFeedContainer.childNodes.length
//console.log(consolidated_from + " cards were consolidated to " + displayed_cards)
console.log("Displayed Cards: " +displayed_cards+" ("+Math.round(100*displayed_cards/stored_art)+"%)");
lazyload();
replace_broken();
get_quote();
decluter_cards = false;
document.getElementById('loading').style.display = "none";
crunch_numbers = false;
}, 1);
}
errors+=1
n_feeds+=1

setTimeout(function(){
crunch_numbers = true;
dedup_articles();
reorderArticles();
displayArticles();
updateItemCount();
displayed_cards = newsFeedContainer.childNodes.length
//console.log(consolidated_from + " cards were consolidated to " + displayed_cards)
console.log("Displayed Cards: " +displayed_cards+" ("+Math.round(100*displayed_cards/stored_art)+"%)");
lazyload();
replace_broken();
get_quote();
decluter_cards = false;
document.getElementById('loading').style.display = "none";
crunch_numbers = false;
}, 1);
});

});


Expand Down

0 comments on commit 68e7aa2

Please sign in to comment.