forked from notBrad/bubo-rss
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
cc32c763db | |||
|
434ada0298 | ||
|
ae12164e0b | ||
|
e81ed2355a | ||
|
0fa785b41d |
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- Browser [e.g. chrome, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Smartphone (please complete the following information):**
|
||||||
|
- Device: [e.g. iPhone6]
|
||||||
|
- OS: [e.g. iOS8.1]
|
||||||
|
- Browser [e.g. stock browser, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Use an official Node.js runtime as a parent image
|
||||||
|
FROM node:14
|
||||||
|
|
||||||
|
# Set the working directory in the container
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# Copy package.json and package-lock.json
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install any dependencies
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Bundle the source code inside the Docker container
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Build the project
|
||||||
|
RUN npm run build:bubo
|
||||||
|
|
||||||
|
# Install 'serve' to serve the static site
|
||||||
|
RUN npm install -g serve
|
||||||
|
|
||||||
|
# Make port 5000 available to the world outside this container
|
||||||
|
EXPOSE 5000
|
||||||
|
|
||||||
|
# Run 'serve' to serve the static site on port 5000
|
||||||
|
CMD ["serve", "-s", "public", "-l", "5000"]
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# 🦉 Bubo Reader
|
# 🦉 Bubo Reader
|
||||||
|
|
||||||
Bubo Reader is a hyper-minimalist <acronym title="Really Simple Syndication">RSS</acronym> and <acronym title="JavaScript Object Notation">JSON</acronym> feed reader you can deploy on your own server, [Netlify](https://netlify.com) in a few steps or [Glitch](https://glitch.com) in even fewer steps! The goal of the project is to generate a webpage that shows a list of links from a collection of feeds organized by category and website. That's it.
|
Bubo Reader is a hyper-minimalist feed reader (RSS, Atom, JSON) you can deploy on your own server, [Netlify](https://netlify.com) in a few steps or [Glitch](https://glitch.com) in even fewer steps! The goal of the project is to generate a webpage that shows a list of links from a collection of feeds organized by category and website. That's it.
|
||||||
|
|
||||||
It is named after this [silly robot owl](https://www.youtube.com/watch?v=MYSeCfo9-NI) from Clash of the Titans (1981).
|
It is named after this [silly robot owl](https://www.youtube.com/watch?v=MYSeCfo9-NI) from Clash of the Titans (1981).
|
||||||
|
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
"https://george.mand.is/feed.xml",
|
"https://george.mand.is/feed.xml",
|
||||||
"https://joy.recurse.com/feed.atom"
|
"https://joy.recurse.com/feed.atom"
|
||||||
],
|
],
|
||||||
"Social": [
|
|
||||||
"https://social.mandis.dev/@georgemandis.rss"
|
|
||||||
],
|
|
||||||
"My GitHub Projects": [
|
"My GitHub Projects": [
|
||||||
"https://github.com/georgemandis.atom",
|
"https://github.com/georgemandis.atom",
|
||||||
"https://github.com/georgemandis/bubo-rss/releases.atom",
|
"https://github.com/georgemandis/bubo-rss/releases.atom",
|
||||||
|
720
package-lock.json
generated
720
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bubo-reader",
|
"name": "bubo-reader",
|
||||||
"version": "2.0.1",
|
"version": "2.0.2",
|
||||||
"description": "A simple but effective feed reader (RSS, JSON)",
|
"description": "A simple but effective feed reader (RSS, JSON)",
|
||||||
"homepage": "https://github.com/georgemandis/bubo-rss",
|
"homepage": "https://github.com/georgemandis/bubo-rss",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
@ -27,19 +27,19 @@
|
|||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": "^5.1.2",
|
"chalk": "^5.2.0",
|
||||||
"node-fetch": "^3.3.0",
|
"node-fetch": "^3.3.1",
|
||||||
"nunjucks": "^3.2.3",
|
"nunjucks": "^3.2.4",
|
||||||
"rss-parser": "^3.12.0"
|
"rss-parser": "^3.13.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.18.4",
|
"@types/node": "^20.2.5",
|
||||||
"@types/nunjucks": "^3.2.1",
|
"@types/nunjucks": "^3.2.2",
|
||||||
"@types/xml2js": "^0.4.11",
|
"@types/xml2js": "^0.4.11",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
||||||
"@typescript-eslint/parser": "^5.45.0",
|
"@typescript-eslint/parser": "^5.59.8",
|
||||||
"eslint": "^8.29.0",
|
"eslint": "^8.42.0",
|
||||||
"tslib": "^2.4.1",
|
"tslib": "^2.5.3",
|
||||||
"typescript": "^4.9.3"
|
"typescript": "^5.1.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
33
src/index.ts
33
src/index.ts
@ -66,7 +66,11 @@ let completed = 0;
|
|||||||
* and we want to build the static output.
|
* and we want to build the static output.
|
||||||
*/
|
*/
|
||||||
const finishBuild: () => void = async () => {
|
const finishBuild: () => void = async () => {
|
||||||
console.log("\nDone fetching everything!");
|
completed++;
|
||||||
|
// if this isn't the last feed, just return early
|
||||||
|
if (completed !== feedListLength) return;
|
||||||
|
|
||||||
|
process.stdout.write("\nDone fetching everything!\n");
|
||||||
|
|
||||||
// generate the static HTML output from our template renderer
|
// generate the static HTML output from our template renderer
|
||||||
const output = render({
|
const output = render({
|
||||||
@ -77,10 +81,10 @@ const finishBuild: () => void = async () => {
|
|||||||
|
|
||||||
// write the output to public/index.html
|
// write the output to public/index.html
|
||||||
await writeFile("./public/index.html", output);
|
await writeFile("./public/index.html", output);
|
||||||
console.log(
|
process.stdout.write(
|
||||||
`\nFinished writing to output:\n- ${feedListLength} feeds in ${benchmark(
|
`\nFinished writing to output:\n- ${feedListLength} feeds in ${benchmark(
|
||||||
initTime
|
initTime
|
||||||
)}\n- ${errors.length} errors`
|
)}\n- ${errors.length} errors\n`
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -103,8 +107,7 @@ const processFeed =
|
|||||||
}) =>
|
}) =>
|
||||||
async (response: Response): Promise<void> => {
|
async (response: Response): Promise<void> => {
|
||||||
const body = await parseFeed(response);
|
const body = await parseFeed(response);
|
||||||
completed++;
|
//skip to the next one if this didn't work out
|
||||||
// skip to the next one if this didn't work out
|
|
||||||
if (!body) return;
|
if (!body) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -124,20 +127,19 @@ const processFeed =
|
|||||||
});
|
});
|
||||||
|
|
||||||
contentFromAllFeeds[group].push(contents as object);
|
contentFromAllFeeds[group].push(contents as object);
|
||||||
console.log(
|
process.stdout.write(
|
||||||
`${success("Successfully fetched:")} ${feed} - ${benchmark(startTime)}`
|
`${success("Successfully fetched:")} ${feed} - ${benchmark(startTime)}\n`
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(
|
process.stdout.write(
|
||||||
`${error("Error processing:")} ${feed} - ${benchmark(
|
`${error("Error processing:")} ${feed} - ${benchmark(
|
||||||
startTime
|
startTime
|
||||||
)}\n${err}`
|
)}\n${err}\n`
|
||||||
);
|
);
|
||||||
errors.push(`Error processing: ${feed}\n\t${err}`);
|
errors.push(`Error processing: ${feed}\n\t${err}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if this is the last feed, go ahead and build the output
|
finishBuild();
|
||||||
completed === feedListLength && finishBuild();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// go through each group of feeds and process
|
// go through each group of feeds and process
|
||||||
@ -150,15 +152,16 @@ const processFeeds = () => {
|
|||||||
for (const feed of feeds) {
|
for (const feed of feeds) {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log(`Fetching: ${feed}...`);
|
process.stdout.write(`Fetching: ${feed}...\n`);
|
||||||
|
|
||||||
fetch(feed)
|
fetch(feed)
|
||||||
.then(processFeed({ group, feed, startTime }))
|
.then(processFeed({ group, feed, startTime }))
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.log(
|
process.stdout.write(
|
||||||
error(`Error fetching ${feed} ${benchmark(startTime)}`)
|
error(`Error fetching ${feed} ${benchmark(startTime)}\n`)
|
||||||
);
|
);
|
||||||
errors.push(`Error fetching ${feed} ${err.toString()}`);
|
errors.push(`Error fetching ${feed} ${err.toString()}\n`);
|
||||||
|
finishBuild();
|
||||||
});
|
});
|
||||||
}, (idx % (feedListLength / MAX_CONNECTIONS)) * DELAY_MS);
|
}, (idx % (feedListLength / MAX_CONNECTIONS)) * DELAY_MS);
|
||||||
idx++;
|
idx++;
|
||||||
|
Loading…
Reference in New Issue
Block a user