Skip to content

Commit

Permalink
fix: rss parser
Browse files Browse the repository at this point in the history
  • Loading branch information
sametcn99 committed May 15, 2024
1 parent 0123c72 commit ec8d3e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 101 deletions.
97 changes: 1 addition & 96 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
"electron-is": "^3.0.0",
"electron-localshortcut": "^3.2.1",
"electron-squirrel-startup": "^1.0.1",
"htmlparser2": "^9.1.0",
"node-stream-zip": "^1.15.0",
"opml-to-json": "^1.0.1",
"rss-parser": "^3.13.0",
"systeminformation": "^5.22.9",
"vue": "^3.4.27"
}
}
}
9 changes: 6 additions & 3 deletions src/app/main/ipc-operations/app-operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { showNotification } from "../../../utils";
import { existsSync, readFileSync, writeFileSync } from "fs-extra";
import { config } from "../../../lib/config";
import path from "path";
import * as htmlparser2 from "htmlparser2";
import Parser from "rss-parser";

// Handles the 'get-app-version' IPC message by returning the app version.
ipcMain.handle(IpcChannels.GET_APP_VERSION, () => {
Expand Down Expand Up @@ -55,8 +55,11 @@ ipcMain.handle(IpcChannels.GET_LOCATION, async () => {
// This function creates a notification with the provided title and message
// and shows it to the user.
ipcMain.handle(IpcChannels.RSS_FEED_PARSER, async (event, url) => {
const data = await fetch(url).then((response) => response.text());
const feed = htmlparser2.parseFeed(data);
const response = await fetch(url).then((response) => response.text());
const data = response.toString();
const parser = new Parser();

const feed = parser.parseString(data);
return feed;
});

Expand Down

0 comments on commit ec8d3e9

Please sign in to comment.