Browse Source

fix favicons

main
matthew 2 years ago
parent
commit
228a216402
  1. 14
      searching-front/services/main.ts
  2. 4
      searching-front/services/modules/parser/index.ts

14
searching-front/services/main.ts

@ -6,13 +6,13 @@ import parser from "./parser"
import influx from "./influx" import influx from "./influx"
const run = async()=>{ const run = async()=>{
console.log('Start domain watcher') // console.log('Start domain watcher')
console.time('watcher') // console.time('watcher')
await domainWatcher(); // await domainWatcher();
console.timeEnd('watcher') // console.timeEnd('watcher')
influx() // influx()
console.log('Start parser'); // console.log('Start parser');
console.time('watcher'); // console.time('watcher');
await parser(); await parser();
console.timeEnd('watcher'); console.timeEnd('watcher');

4
searching-front/services/modules/parser/index.ts

@ -32,8 +32,8 @@ const getFaviconUrl = (dom:JSDOM, domain:string) => {
try { try {
url = new URL(href); url = new URL(href);
} catch(e){ } catch(e){
url = new URL(domain+href); url = new URL(domain+'/'+href);
url.pathname = url.pathname.replace('//','/'); url.pathname = url.pathname.replaceAll('//','/');
} }
return url.toString(); return url.toString();
} }

Loading…
Cancel
Save