Skip to content

Commit

Permalink
Add extra feeds (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajbos authored Jul 1, 2024
1 parent 9912b91 commit f0f602e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions data.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@
{
"name": "Copilot Blog",
"url": "https://github.blog/feed/?tag=github-copilot%2Cgithub-copilot-extensions%2Cgithub-copilot-chat"
},
{
"name": "Visual Studio - GitHub Copilot",
"url": "https://devblogs.microsoft.com/visualstudio/tag/github-copilot/feed/",
"cors": true
},
{
"name": "Visual Studio - Copilot",
"url": "https://devblogs.microsoft.com/visualstudio/tag/copilot/feed/",
"cors": true
}
]
},
Expand Down
8 changes: 8 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ document.addEventListener('DOMContentLoaded', function() {
const filterButtonsContainer = document.getElementById('filter-buttons');
const feedCounts = {}; // Store the count of posts for each feed
data.rssFeeds.feeds.forEach(feed => {
if (feed.cors) {
// skip this feed for now, we cannot handle this with this script atm
return;
}
feedCounts[feed.name] = 0; // Initialize count for each feed
const button = document.createElement('button');
button.textContent = feed.name;
Expand Down Expand Up @@ -75,6 +79,10 @@ document.addEventListener('DOMContentLoaded', function() {
const rssFeeds = data.rssFeeds.feeds;
let totalItemCount = 0; // Initialize total item count
rssFeeds.forEach(feed => {
if (feed.cors) {
// skip this feed for now, we cannot handle this with this script atm
return;
}
fetch(feed.url)
.then(response => response.text())
.then(str => new window.DOMParser().parseFromString(str, "text/xml"))
Expand Down

0 comments on commit f0f602e

Please sign in to comment.