Giter Site home page Giter Site logo

crawlab-team / artipub Goto Github PK

View Code? Open in Web Editor NEW
3.0K 76.0 516.0 14.91 MB

Article publishing platform that automatically distributes your articles to various media channels

Home Page: http://121.41.169.182:8000

License: BSD 3-Clause "New" or "Revised" License

JavaScript 6.30% TypeScript 87.53% Dockerfile 0.08% HTML 0.11% Shell 0.10% SCSS 0.14% Less 4.48% EJS 1.26%
docker nodejs typescript media article mongodb segmentfault csdn article-publisher

artipub's Introduction

ArtiPub 内容创作者的搬运工,一处书写,随处可见

ArtiPub (Article Publisher 的简称,意为 "文章发布者") 是一款开源的一文多发平台,可以帮助文章作者将编写好的文章自动发布到掘金、SegmentFault、CSDN、知乎、开源**等技术媒体平台,传播优质知识,获取最大的曝光度。ArtiPub 安装简单,提供了多种安装方式,可以一键安装使用,安装一般只要 5 分钟。

ArtiPub 目前支持文章编辑、文章发布、数据统计的功能,后期我们会加入存量文章导入、数据分析的功能,让您更好的管理、优化您的技术文章。此外,我们还会接入更多媒体渠道,真正做到让文章随处可阅。

⚠️⚠️⚠️ 增加登录注册功能之后,mongodb表结构发生较大变化,前后不兼容,建议重命名mongodb库名以做备份,后端应用启动后会重新初始化 artipub 库,再迁移原来文章至新表

Demo 地址

http://121.41.169.182:8000/

浏览器插件配置后端地址: http://121.41.169.182:3000

⚠️⚠️⚠️ 目前使用的是免费MongoDB服务,只有512M空间,会不定期删除内容,请自行做好文章备份。

由于各个平台会不定期更新文章发布页面,所以部分平台可能会失效,没有那么及时更新支持。请勿发布垃圾文章,否则账号可能会被对应平台封禁。

支持平台

git clone 备用地址

如若github clone网络过慢,可使用如下同步更新的国内仓库。

预览截图

登录注册

平台管理

平台管理

文章管理

文章编辑

文章发布

Chrome 插件

安装要求

Docker 安装

  • Docker: 18.03
  • Docker Compose: 1.24.1

NPM 或源码安装

  • MongoDB: 3.6+
  • NodeJS: 10+
  • NPM: > 5+ , < 7+

安装方式

ArtiPub 提供 3 种安装方式如下。

  • [Docker](# 通过 Docker 安装) (大约 5 分钟): 适合对 Docker 有一定基础的开发者
  • [npm](# 通过 npm 包安装) (大约 3 分钟): 适合熟悉 Node.js 或 npm 的开发者
  • [源码](# 通过源码安装) (大约 5-10 分钟): 适合希望了解内核原理的开发者

通过 Docker 安装

通过 Docker,可以免去安装 MongoDB 的步骤,也是我们最推荐的安装方式。使用 Docker 安装 ArtiPub 前,请确保您安装了 Docker 以及 Docker Compose。docker运行 ArtiPub 有两种方式。

  • 通过 docker-compose.yaml 启动

适用于你本地之前没有运行 mongodb 容器。 在您的项目目录下创建 docker-compose.yaml 文件,输入如下内容。

version: "3.3"
services:
  app:
    image: "tanliyuan123/artipub:1.2.0"
    environment:
      MONGO_HOST: "mongo"
      # MONGO_USERNAME: root
      # MONGO_PASSWORD: example
      ARTIPUB_API_ADDRESS: "http://localhost:3000" # 后端API地址,如果安装地址不在本机,请修改为协议+服务器IP地址+端口号(默认为3000)
    ports:
      - "8000:8000" # frontend
      - "3000:3000" # backend
    depends_on:
      - mongo
  mongo:
    image: mongo:latest
    restart: always
    #volumes:
    #  - "E:\\mongodb:/data/db"
    ports:
      - "27017:27017"

然后在命令行中输入如下命令。如果你想再次启动容器时上次内容不会被销毁,去掉 volumes 两行的注释,改成自己本地路径即可。

docker-compose up

然后在浏览器中输入 http://localhost:8000 可以看到界面。

注意⚠️,如果您的 Docker 宿主机不是本机,例如您用了 Docker Machine 或者 Docker 服务在其他机器上,您需要将环境变量 ARTIPUB_API_ADDRESS 改为宿主机 IP + 端口号(默认 3000)。然后,在浏览器输入 http://< 宿主机 IP>:8000 即可看到界面。

  • 独立启动 artipub 镜像

如果你本地已有启动的mongodb容器,不想用上面方式再起一个。其中 goofy_ganguly 为本地已启动的 mongodb 容器名, 替换成你本地的即可。

docker run --rm -it --link goofy_ganguly  -p 3000:3000/tcp  -p 8000:8000/tcp  tanliyuan123/artipub:1.2.0

通过 npm 包安装

如果您对 npm 熟悉,且已经有 MongoDB 的环境,这是最为快捷的方式。

从0.1.6版本开始前后端分开打包.

安装 artipub-front 前端包

artipub-front

安装 artipub-backend 后端包

artipub-backend

安装 npm 包时,为了加速下载速度,可以加入 --registry 参数来设置镜像源(后面源码安装时也可以这样操作)

npm install -g artipub-frontend --registry=https://registry.npm.taobao.org

成功运行后,在浏览器中输入 http://localhost:8000 可以看到界面。

通过源码安装

克隆 Github Repo

git clone https://github.com/crawlab-team/artipub

安装 npm 包

cd artipub/frontend
npm install

cd artipub/backend
npm install

启动前端

//frontend 目录下
npm run dev

启动后端

//backend 目录下
npm run dev



//运行prod 需先全局安装pm2
npm i pm2 -g
npm run prod

配置数据库

数据库的配置在 backend/src/config.ts 中,可以按情况配置。

配置后端 API 地址

如果您部署的服务不在本机,需要在 frontend/src/constants.ts 中将 apiEndpoint 改成对应的 IP 地址 + 端口。

原理

利用了爬虫技术将文章发布到各大平台。ArtiPub 的爬虫是用了 Google 开发的自动化测试工具 Puppeteer,这个工具不仅可以获取需要有 ajax 动态内容的数据,还可以来做一些模拟操作,类似于 Selenium,但更强大。如何进行登陆操作呢?其实 ArtiPub 是通过 Chrome 插件获取了用户登陆信息(Cookie),将 Cookie 注入到 Puppeteer 操作的 Chromium 浏览器中,然后浏览器就可以正常登陆网站进行发文操作了。Cookie 是保存在用户自己搭建的 MongoDB 数据库里,不对外暴露,因此很安全。

下图是 ArtiPub 的架构示意图:

img

架构原理简介如下:

  • 后端(Backend)是整个架构的中枢,负责给前端交换数据、储存读取数据库、控制爬虫、收集 Cookie 等;
  • Chrome 插件(Chrome Extension)只负责从网站(Sites)获取 Cookie;
  • 爬虫(Spiders)被后端控制,负责在网站上发布文章和抓取数据;
  • 数据库(MongoDB)负责储存数据;
  • 前端(Frontend)是一个 React 应用,是 Ant Design Pro 改造而来的。

为什么创建 ArtiPub

程序员和技术人员常常会写技术文章和博客,用作技术分享、产品分享或提供咨询等等。技术博主通常需要在多个媒体渠道发布文章,例如掘金、SegmentFault、CSDN、知乎、简书、微信公众号等等,以求最大的关注度。但是,发布文章到这么多平台费时费神,需要不断地复制粘贴;同时,作者想查看阅读数时还需要来回切换各个网站来进行统计。这非常不方便。ArtiPub 主要就是为了来解决上述这些问题的。

市面上已经存在一文多发平台了,例如 OpenWrite,为何还要创建 ArtiPub 呢?或许其他一文多发平台也是一个替代方案,但它们要求用户将自己的账户信息例如 Cookie 或账号密码上传到对方服务器,这很不安全,一旦平台发生问题,自己的账户信息会遭到泄漏。虽然我相信一般平台不会恶意操作用户的账户,但如果出现误操作,您的账户隐私将遭到泄漏,平台上的财产也可能遭到损坏,有这样的风险需要考虑。ArtiPub 不要求用户上传账户信息,所有账户信息全部保存在用户自己的数据库里,因此规避了这个安全风险。

另外,由于 ArtiPub 是开源的,JS 源码也比较易于理解,可扩展性很强,用户如果有其他平台的接入需求,完全可以更改源码来实现自己的需求,不用等待平台更新。开发组也将持续开发 ArtiPub,将其打造得更实用和易用。

贡献代码

非常欢迎优秀的开发者来贡献 ArtiPub。在提 Pull Request 之前,请首先阅读源码,了解原理和架构。如果不懂的可以加作者微信 tikazyq1 注明 ArtiPub。

社区

如果您觉得 ArtiPub 对您有帮助,请扫描下方群二维码,如果群满,请加作者微信 tikazyq1 并注明 "ArtiPub",作者会将你拉入群。

artipub's People

Contributors

acooler15 avatar deppwang avatar kingname avatar marvzhang avatar mtianyan avatar tanliyuan avatar tikazyq avatar zhangnew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

artipub's Issues

掘金发布失败,docker日志如下

OPTIONS /tasks/batch 200 0.194 ms - 2
PUT /tasks/batch 200 22.429 ms - 15
GET /articles/5d905104dd6531001e7cc4c8/tasks 200 13.045 ms - 9582
OPTIONS /tasks/batch 200 0.184 ms - 2
PUT /tasks/batch 200 19.476 ms - 15
POST /articles/5d905104dd6531001e7cc4c8/publish 200 3.168 ms - 15
[2019-09-29T09:29:34.003] [INFO] default - Publish task started
[Function: JuejinSpider]
[PCR] Chromium revision: 686378
[PCR] Detected local chromium is already downloaded
[PCR] Chromium executablePath: /root/.chromium-browser-snapshots/linux-686378/chrome-linux/chrome
[PCR] Chromium version: HeadlessChrome/78.0.3882.0
[PCR] Chromium launchable: true
[PCR] Puppeteer version: 1.20.0
[2019-09-29T09:29:34.307] [INFO] default - logging in... navigating to https://juejin.im/login
GET /articles/5d905104dd6531001e7cc4c8/tasks 200 25.930 ms - 9587
[2019-09-29T09:29:40.114] [INFO] default - Logged in
[2019-09-29T09:29:40.114] [INFO] default - navigating to https://juejin.im/editor/drafts/new
GET /articles/5d905104dd6531001e7cc4c8/tasks 304 11.074 ms - -
GET /articles/5d905104dd6531001e7cc4c8/tasks 304 18.417 ms - -
GET /articles/5d905104dd6531001e7cc4c8/tasks 304 10.472 ms - -
GET /articles/5d905104dd6531001e7cc4c8/tasks 304 11.335 ms - -
GET /articles/5d905104dd6531001e7cc4c8/tasks 304 11.934 ms - -
GET /articles/5d905104dd6531001e7cc4c8/tasks 304 14.273 ms - -
GET /articles/5d905104dd6531001e7cc4c8/tasks 304 10.716 ms - -
{ TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
at Promise.then (/app/node_modules/puppeteer-core/lib/LifecycleWatcher.js:142:21)
at
-- ASYNC --
at Frame. (/app/node_modules/puppeteer-core/lib/helper.js:111:15)
at Page.goto (/app/node_modules/puppeteer-core/lib/Page.js:674:49)
at Page. (/app/node_modules/puppeteer-core/lib/helper.js:112:23)
at JuejinSpider.afterGoToEditor (/app/spiders/juejin.js:6:25)
at JuejinSpider.goToEditor (/app/spiders/base.js:202:16)
at name: 'TimeoutError' }
[2019-09-29T09:30:15.844] [INFO] default - Publish task ended
GET /articles/5d905104dd6531001e7cc4c8/tasks 200 10.691 ms - 9523

无法发布到“今日头条”

今天使用v0.1.3版本,博文发布到“今日头条”时出现报错信息:Error: Evaluation failed: TypeError: Cannot read property 'getAttribute' of null at puppeteer_evaluation_script:2:62,麻烦处理一下,谢谢。

npm install安装好慢

你好,能问一下这个npm install 是安装的这个项目环境的包,还是安装了所有的。我是换了源安装的,感觉还是很慢,

建议添加中文错别字检查

作为一个手残党,经常会打错字。希望可以添加这个能力,在提交之前,扫描一遍可能的错别字。

docker-compose部署报连接mongodb数据库错误

docker-compose部署报连接mongodb数据库错误
错误信息如下:

UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]

需要补充文档

首先,这是一个很棒的工具 。当看到这个工具的时候,觉得很惊喜,因为这是我一直以来要寻找的工具。 之前确实遇到这类痛点。发布多平台时,需要一个个登录,复制粘贴。 虽然网络上有一些新媒体多平台工具,但是更多是针对头条,百度百家,网易号等通用自媒体平台,针对技术类网站的比较少。

这个项目文档比较少,希望作者能够补充文档,让我们尽快玩起来,感恩!

博客园发布类型错误&获取url错误

  1. 原创应该是发布“随笔”

    文章(默认不在您的博客首页显示,主要用于转载,发布原创博文要通过“随笔”)

  2. 获取保存的url错误,应该为获取id,非博客名

【docker版本】后端访问问题

安装的宿主机ip:192.168.245.200
1、docker的配置文件未改变。容器内有docker-compose文件,config.js的mongo地址配置依旧是localhost,没使用宿主机的docker-compose配置
2、web页面访问不到后端服务,小助手可以,下面是助手访问的日志

[2019-09-24T00:38:59.792] [INFO] default - listening on port 3000
GET /platforms 304 50.753 ms - -
POST /cookies 200 212.127 ms - 15

web访问一下两个接口,没结果

http://192.168.245.200:3000/platforms
http://192.168.245.200:3000/platforms/checkCookies

mongo中有cookie的数据

文章发布到 SegmentFault 失败

如图,一篇文章发布到掘金成功,但发布到 SegmentFault 失败。

image

错误信息(docker 的 log):

app_1    | [2019-09-23T02:59:15.003] [INFO] default - Publish task started
app_1    | [PCR] Chromium revision: 686378
app_1    | [PCR] Detected local chromium is already downloaded
app_1    | [PCR] Chromium executablePath: /root/.chromium-browser-snapshots/linux-686378/chrome-linux/chrome
app_1    | [PCR] Chromium version: HeadlessChrome/78.0.3882.0
app_1    | [PCR] Chromium launchable: true
app_1    | [PCR] Puppeteer version: 1.20.0
app_1    | [2019-09-23T02:59:15.395] [INFO] default - navigating to https://segmentfault.com/write
app_1    | GET /articles/5d8830a53c42ed001a4bdb01/tasks 200 20.951 ms - 7942
app_1    | [2019-09-23T02:59:23.136] [INFO] default - input editor title and content
app_1    | Error: Evaluation failed: TypeError: Cannot read property 'focus' of null
app_1    |     at inputTitle (__puppeteer_evaluation_script__:3:8)
app_1    |     at ExecutionContext._evaluateInternal (/app/node_modules/puppeteer-core/lib/ExecutionContext.js:122:13)
app_1    |     at <anonymous>
app_1    |     at process._tickCallback (internal/process/next_tick.js:189:7)
app_1    |   -- ASYNC --
app_1    |     at ExecutionContext.<anonymous> (/app/node_modules/puppeteer-core/lib/helper.js:111:15)
app_1    |     at DOMWorld.evaluate (/app/node_modules/puppeteer-core/lib/DOMWorld.js:112:20)
app_1    |     at <anonymous>
app_1    |   -- ASYNC --
app_1    |     at Frame.<anonymous> (/app/node_modules/puppeteer-core/lib/helper.js:111:15)
app_1    |     at Page.evaluate (/app/node_modules/puppeteer-core/lib/Page.js:833:43)
app_1    |     at Page.<anonymous> (/app/node_modules/puppeteer-core/lib/helper.js:112:23)
app_1    |     at SegmentfaultSpider.inputEditor (/app/spiders/base.js:236:21)
app_1    |     at SegmentfaultSpider.run (/app/spiders/base.js:290:16)
app_1    |     at <anonymous>
app_1    | [2019-09-23T02:59:23.171] [INFO] default - Publish task ended

建议增加更详细的文档

非前端、后端开发,不懂JS,感觉使用起来有点困难,仓库没有什么可以参考的文档,建议增加更加详细的文档,从安装到配置到使用等,谢谢

发布到CSDN出现 Error: Failed to launch chrome! 错误

Docker搭建的环境

在发布到CSDN的时候出现

Error: Failed to launch chrome! (chrome:404): Gtk-WARNING **: 01:23:50.149: cannot open display: TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

image

10个平台发布结果反馈

1.掘金报错:Error: Evaluation failed: TypeError: Cannot read property 'click' of null at puppeteer_evaluation_script:2:78
2.简书报错:Error: Evaluation failed: TypeError: Cannot read property 'focus' of null at inputFooter (puppeteer_evaluation_script:4:8)
3.今日头条报错:Error: Evaluation failed: TypeError: Cannot read property 'focus' of null at inputTitle (puppeteer_evaluation_script:3:8)
4.博客园报错:Error: Evaluation failed: TypeError: Cannot read property 'focus' of null at inputTitle (puppeteer_evaluation_script:3:8)
5.V2ex报错:Error: Evaluation failed: TypeError: Cannot read property 'focus' of null at inputTitle (puppeteer_evaluation_script:3:8)
6.微信公众号素材发布不成功,相关报错:RequestError: Error: form-data: ENOENT: no such file or directory, open '/Users/marvzhang/projects/artipub/public/favicon.png'

文章发布到知乎实际成功,但显示失败

发布后显示失败,但知乎专栏中实际上已有该文章。

错误信息:

[2019-09-23T14:39:54.008] [INFO] default - Publish task started
[PCR] Chromium revision: 686378
[PCR] Detected local chromium is already downloaded
[PCR] Chromium executablePath: /Users/william/.chromium-browser-snapshots/mac-686378/chrome-mac/Chromium.app/Contents/MacOS/Chromium
[PCR] Chromium version: HeadlessChrome/78.0.3882.0
[PCR] Chromium launchable: true
[PCR] Puppeteer version: 1.20.0
GET /articles/5d88620daabb861a5ceba3a0/tasks 200 13.971 ms - 7942
[2019-09-23T14:39:55.104] [INFO] default - navigating to https://zhuanlan.zhihu.com/write
GET /articles/5d88620daabb861a5ceba3a0/tasks 304 15.616 ms - -
Error: Protocol error (Runtime.evaluate): Session closed. Most likely the page has been closed.
    at CDPSession.send (/Users/william/projects/artipub/node_modules/puppeteer-core/lib/Connection.js:180:29)
    at ExecutionContext._evaluateInternal (/Users/william/projects/artipub/node_modules/puppeteer-core/lib/ExecutionContext.js:73:75)
    at ExecutionContext.evaluateHandle (/Users/william/projects/artipub/node_modules/puppeteer-core/lib/ExecutionContext.js:57:17)
    at ExecutionContext.<anonymous> (/Users/william/projects/artipub/node_modules/puppeteer-core/lib/helper.js:112:23)
    at _documentPromise.executionContext.then (/Users/william/projects/artipub/node_modules/puppeteer-core/lib/DOMWorld.js:132:38)
  -- ASYNC --
    at Frame.<anonymous> (/Users/william/projects/artipub/node_modules/puppeteer-core/lib/helper.js:111:15)
    at Page.$ (/Users/william/projects/artipub/node_modules/puppeteer-core/lib/Page.js:318:29)
    at Page.<anonymous> (/Users/william/projects/artipub/node_modules/puppeteer-core/lib/helper.js:112:23)
    at ZhihuSpider.afterGoToEditor (/Users/william/projects/artipub/spiders/zhihu.js:30:36)
[2019-09-23T14:40:03.275] [INFO] default - Publish task ended

调试发现,浏览器最后跳转到了已发布的文章页面,并跳出弹窗“邀请你开通专栏”。

发布知乎出现排版混乱情况

出现混乱的markdown代码:

```shell
echo aaa
echo bbb
\```

现在artipub支持的代码:

```shell

echo aaa
echo bbb
\```

语言标记需要和代码有个空格才能正确排版,请修复这个bug

平台更新cookie失败

已经通过chrome插件获取到cookie并且成功存储到了mongodb,但是在平台内点击更新cookie,一直只是显示按钮在转 没有任何其他反应

OS: CentOS
Deployment: Docker

exec.js过早地被server.js引入导致exec.js中的mongodb连接失败的问题

server.js中,exec.js被引入的时候config还没被覆盖

const config = require('./config')
const exec = require('./exec')

// 环境变量覆盖
console.log(process.env)
if (process.env.MONGO_HOST) config.MONGO_HOST = process.env.MONGO_HOST
if (process.env.MONGO_PORT) config.MONGO_PORT = process.env.MONGO_PORT
if (process.env.MONGO_DB) config.MONGO_DB = process.env.MONGO_DB
if (process.env.MONGO_USERNAME) config.MONGO_USERNAME = process.env.MONGO_USERNAME
if (process.env.MONGO_PASSWORD) config.MONGO_PASSWORD = process.env.MONGO_PASSWORD
if (process.env.MONGO_AUTH_DB) config.MONGO_AUTH_DB = process.env.MONGO_AUTH_DB

导致exec.js中的mongodb连接部分会使用config.js中的默认配置

// mongodb连接
mongoose.Promise = global.Promise
if (config.MONGO_USERNAME) {
  mongoose.connect(`mongodb://${config.MONGO_USERNAME}:${config.MONGO_PASSWORD}@${config.MONGO_HOST}:${config.MONGO_PORT}/${config.MONGO_DB}`, { useNewUrlParser: true })
} else {
  mongoose.connect(`mongodb://${config.MONGO_HOST}:${config.MONGO_PORT}/${config.MONGO_DB}`, { useNewUrlParser: true })
}

config.js:

module.exports = {
  HOST: '0.0.0.0',
  PORT: 3000,
  MONGO_HOST: 'localhost',
  MONGO_PORT: '27017',
  MONGO_DB: 'artipub',
  MONGO_USERNAME: '',
  MONGO_PASSWORD: '',
  MONGO_AUTH_DB: 'admin'
}

current Server Discovery and Monitoring engine is deprecated

(node:23) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.

mongdb 的错误, 解决办法: 可以参考 Automattic/mongoose#8362
https://blog.csdn.net/Mr_pets/article/details/102990293.

具体修改: 从抱错日志看需要修改 /app/exec.js:16:12 文件中的16行12列的连接mongodb连接代码,

添加导入本地文章功能

目前文章管理只支持在线新建 markdown 文章。但很多人用 GitHub Pages 搭博客,文章肯定是主要放在本地的 markdown 文件。这种情况如果有导入本地文章的功能会更方便。

实时预览中,由滚动同步引起的瑕疵

因为 react-markdown-editor-lite 默认是 左右滚动同步的
然后md语法转化html之后,可能导致布局的变高,使编辑内容和实时预览的不对应

建议:
artipub/src/pages/ArticleEdit/ArticleEdit.tsx 163行
添加 config={{synchScroll:false}} 关闭同步滚动会更好些

发布文章报错

{ TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
app_1 | at Promise.then (/app/node_modules/puppeteer-core/lib/LifecycleWatcher.js:142:21)
app_1 | at
app_1 | -- ASYNC --
app_1 | at Frame. (/app/node_modules/puppeteer-core/lib/helper.js:111:15)
app_1 | at Page.goto (/app/node_modules/puppeteer-core/lib/Page.js:674:49)
app_1 | at Page. (/app/node_modules/puppeteer-core/lib/helper.js:112:23)
app_1 | at JianshuSpider.goToEditor (/app/spiders/base.js:200:21)
app_1 | at JianshuSpider.run (/app/spiders/base.js:318:16)
app_1 | at
app_1 | at process._tickCallback (internal/process/next_tick.js:189:7) name: 'TimeoutError' }

文章发布到CSDN失败

由于时间问题,暂时只提供CSDN的两个问题:

  1. CSDN中,其实用户还没有登陆,但是却显示获取了cookies成功,应该是过期了。

导致puppeteer获取不到需要发发博客的按钮。然后导致错误。

  1. 扫码登录了,解决了这个问题之后,虽然发布成功,但是Content丢失,只有工具默认的加的“本篇文章由一文多发平台 ArtiPub 自动发布”这一句话

发布失败,Docker

错误日志:

博客园
Error: Evaluation failed: TypeError: Cannot read property 'focus' of null at inputTitle (__puppeteer_evaluation_script__:3:8)
简书
Error: Evaluation failed: TypeError: Cannot read property 'focus' of null at inputFooter (__puppeteer_evaluation_script__:4:8)

关于artipub权限问题

1、请问如果安装artipub在公网服务器,那么知道服务器ip端口的人是不是都能用了,没有限制?这样用户的cookies数据是存储在服务器?还是本地浏览器?

2、建议在8000端口的界面增加账号密码登录。

添加后端 API 接口的文档

除了目前在浏览器中发布文章的方式,未来还可以支持命令行发布文章的方式。前端和命令行程序都可以调用后端的统一接口来工作。后端 API 接口的文档有必要完善一下。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.