From a8cc190ef10541314e6f7c1e287a86a20b9f28f7 Mon Sep 17 00:00:00 2001 From: Perception Date: Mon, 11 Apr 2022 10:54:25 +0000 Subject: [PATCH] s/dailystormer.name/dailystormer.cn/ --- bin/articles-update | 4 ++-- bin/scan | 2 +- index.js | 4 ++-- templates/_article-link.ejs | 2 +- templates/search.ejs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/articles-update b/bin/articles-update index 66c1717..82fcfe5 100755 --- a/bin/articles-update +++ b/bin/articles-update @@ -7,12 +7,12 @@ const Bluebird = require('bluebird') const ds = require('../index') const db = ds.db() -const feedURL = 'https://dailystormer.name/feed/' +const feedURL = 'https://dailystormer.cn/feed/' async function main() { const feed = await ds.fetchArticlesFromFeed(feedURL) Bluebird.each(feed, (async (item) => { - const url = `https://dailystormer.name${item.slug}` + const url = `https://dailystormer.cn${item.slug}` const more = await ds.fetchArticle(url) item.tags = more.tags item.categories = more.categories diff --git a/bin/scan b/bin/scan index b812962..cdccc64 100755 --- a/bin/scan +++ b/bin/scan @@ -7,7 +7,7 @@ const Bluebird = require('bluebird') const ds = require('../index') const db = ds.db() -const baseURL = 'https://dailystormer.name' +const baseURL = 'https://dailystormer.cn' async function main() { program.option('-t, --taxonomy ', `"section" or "tag"`, 'section') diff --git a/index.js b/index.js index 92fd0a9..093e745 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ function db(options={}) { return new Database(dbPath, options) } -async function fetchFeed(feedURL='https://dailystormer.name/feed/') { +async function fetchFeed(feedURL='https://dailystormer.cn/feed/') { const parser = new RSSParser() const res = await axios.get(feedURL) const feed = await parser.parseString(res.data) @@ -26,7 +26,7 @@ async function fetchFeed(feedURL='https://dailystormer.name/feed/') { * @param {String} feedURL - URL of the feed * @returns {Object} parsed RSS feed */ -async function fetchArticlesFromFeed(feedURL='https://dailystormer.name/feed/') { +async function fetchArticlesFromFeed(feedURL='https://dailystormer.cn/feed/') { const feed = await fetchFeed(feedURL); return feed.items.map((a) => { const slug = url.parse(a.link).pathname diff --git a/templates/_article-link.ejs b/templates/_article-link.ejs index 9d4260f..f2b42b5 100644 --- a/templates/_article-link.ejs +++ b/templates/_article-link.ejs @@ -1,6 +1,6 @@ <% let _slug = art.slug.replace(/\//g, '') %>
-
<%- art.title || 'Untitled' %> [json]
+
<%- art.title || 'Untitled' %> [json]
by "><%- art.author %> diff --git a/templates/search.ejs b/templates/search.ejs index 929bcfa..0cd1138 100644 --- a/templates/search.ejs +++ b/templates/search.ejs @@ -8,7 +8,7 @@
<% results.forEach((r) => { %>
-
<%- r.title %>
+
<%- r.title %>
<%- r.author %>

<%- r.snippet %>