Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgodhani committed May 11, 2021
1 parent 71ef05d commit 91a83e7
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 359 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "raven-reader",
"productName": "Raven Reader",
"version": "1.0.51",
"version": "1.0.52",
"author": "Hello Efficiency Inc. <welcome@helloefficiency.com>",
"description": "Simple desktop RSS Reader",
"license": "MIT",
Expand Down Expand Up @@ -104,6 +104,7 @@
"jquery": "3.6.0",
"electron-icon-builder/**/yargs-parser": "13.1.2",
"@postlight/mercury-parser/jquery": "3.5.0",
"vue-cli-plugin-electron-builder/**/minimist": "0.2.1"
"vue-cli-plugin-electron-builder/**/minimist": "0.2.1",
"vue-cli-plugin-electron-builder/electron-builder": "22.10.4"
}
}
15 changes: 15 additions & 0 deletions src/bridge/rss.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import RssParser from 'rss-parser'
import rssFinder from 'rss-finder'
import normalizeUrl from 'normalize-url'
import {
validate
} from 'fast-xml-parser'
import fetch from 'node-fetch'

const parser = new RssParser({
requestOptions: {
Expand All @@ -21,6 +25,17 @@ const parser = new RssParser({
})

export default {
async checkXml (link) {
const content = await fetch(link, {
cors: 'no-cors',
referrer: '',
credentials: 'omit',
redirect: 'follow'
})
const data = await content.text()
const validateXml = validate(data)
return validateXml === true
},
async parseRssUrl (url) {
return await parser.parseURL(url)
},
Expand Down
12 changes: 1 addition & 11 deletions src/components/SubscribeModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
<script>
import normalizeUrl from 'normalize-url'
import unescape from '../services/unescape'
import { validate } from 'fast-xml-parser'
import helper from '../services/helpers'
export default {
Expand Down Expand Up @@ -156,22 +155,13 @@ export default {
addCategory () {
this.showAddCat = !this.showAddCat
},
async isContentXML (link) {
const content = await fetch(link, {
mode: 'no-cors',
redirect: 'follow'
})
const data = await content.text()
const validateXml = validate(data)
return validateXml === true
},
async fetchFeed () {
const self = this
this.loading = true
if (!this.$store.state.Setting.offline) {
if (this.feed_url) {
try {
const isXML = await this.isContentXML(normalizeUrl(this.feed_url, { stripWWW: false, removeTrailingSlash: false }))
const isXML = await window.rss.checkXml(normalizeUrl(this.feed_url, { stripWWW: false, removeTrailingSlash: false }))
window.rss.findRss(this.feed_url).then(
res => {
this.loading = false
Expand Down
Loading

0 comments on commit 91a83e7

Please sign in to comment.