This repository was archived by the owner on Sep 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +196
-359
lines changed
Expand file tree Collapse file tree 4 files changed +196
-359
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " raven-reader" ,
33 "productName" : " Raven Reader" ,
4- "version" : " 1.0.51 " ,
4+ "version" : " 1.0.52 " ,
55 "author" :
" Hello Efficiency Inc. <[email protected] >" ,
66 "description" : " Simple desktop RSS Reader" ,
77 "license" : " MIT" ,
104104 "jquery" : " 3.6.0" ,
105105 "electron-icon-builder/**/yargs-parser" : " 13.1.2" ,
106106 "@postlight/mercury-parser/jquery" : " 3.5.0" ,
107- "vue-cli-plugin-electron-builder/**/minimist" : " 0.2.1"
107+ "vue-cli-plugin-electron-builder/**/minimist" : " 0.2.1" ,
108+ "vue-cli-plugin-electron-builder/electron-builder" : " 22.10.4"
108109 }
109110}
Original file line number Diff line number Diff line change 11import RssParser from 'rss-parser'
22import rssFinder from 'rss-finder'
33import normalizeUrl from 'normalize-url'
4+ import {
5+ validate
6+ } from 'fast-xml-parser'
7+ import fetch from 'node-fetch'
48
59const parser = new RssParser ( {
610 requestOptions : {
@@ -21,6 +25,17 @@ const parser = new RssParser({
2125} )
2226
2327export default {
28+ async checkXml ( link ) {
29+ const content = await fetch ( link , {
30+ cors : 'no-cors' ,
31+ referrer : '' ,
32+ credentials : 'omit' ,
33+ redirect : 'follow'
34+ } )
35+ const data = await content . text ( )
36+ const validateXml = validate ( data )
37+ return validateXml === true
38+ } ,
2439 async parseRssUrl ( url ) {
2540 return await parser . parseURL ( url )
2641 } ,
Original file line number Diff line number Diff line change 116116<script >
117117import normalizeUrl from ' normalize-url'
118118import unescape from ' ../services/unescape'
119- import { validate } from ' fast-xml-parser'
120119import helper from ' ../services/helpers'
121120
122121export default {
@@ -156,22 +155,13 @@ export default {
156155 addCategory () {
157156 this .showAddCat = ! this .showAddCat
158157 },
159- async isContentXML (link ) {
160- const content = await fetch (link, {
161- mode: ' no-cors' ,
162- redirect: ' follow'
163- })
164- const data = await content .text ()
165- const validateXml = validate (data)
166- return validateXml === true
167- },
168158 async fetchFeed () {
169159 const self = this
170160 this .loading = true
171161 if (! this .$store .state .Setting .offline ) {
172162 if (this .feed_url ) {
173163 try {
174- const isXML = await this . isContentXML (normalizeUrl (this .feed_url , { stripWWW: false , removeTrailingSlash: false }))
164+ const isXML = await window . rss . checkXml (normalizeUrl (this .feed_url , { stripWWW: false , removeTrailingSlash: false }))
175165 window .rss .findRss (this .feed_url ).then (
176166 res => {
177167 this .loading = false
You can’t perform that action at this time.
0 commit comments