ArtiPub (short for Article Publisher, meaning "article publisher") is an open source multi-posting platform that can help article authors automatically publish their written articles to Nuggets, SegmentFault, CSDN, Zhihu, Open Source China and other technologies Media platform to disseminate high-quality knowledge and gain maximum exposure. ArtiPub is easy to install and provides a variety of installation methods. It can be installed and used with one click. The installation usually only takes 5 minutes.
ArtiPub currently supports the functions of article editing, article publishing, and data statistics. Later, we will add the functions of importing stock articles and data analysis, allowing you to better manage and optimize your technical articles. In addition, we will also access more media channels to truly make articles available everywhere.
Support platform
- Nuggets
- SegmentFault
- CSDN
- Brief Book
- Know almost
- Open Source China
- Today's headlines
- Blog garden
- Baidu Baijiahao
- 51CTO
- Developer headlines
- WeChat public account
git clone alternate address
If the github clone network is too slow, you can use the following synchronously updated domestic warehouses.
Preview screenshot
Platform management
Article management
Article editor
Article publishing
Chrome plugin
Installation requirements
Docker installation
- Docker: 18.03
- Docker Compose: 1.24.1
NPM or source installation
- MongoDB: 3.6+
- NodeJS: 10+
Installation method
ArtiPub provides 3 installation methods as follows.
- [Docker](# Install via Docker) (about 5 minutes): Suitable for developers who have a certain foundation in Docker
- [npm](# Install via npm package) (about 3 minutes): Suitable for developers who are familiar with Node.js or npm
- [Source code](# Install via source code) (about 5-10 minutes): Suitable for developers who want to understand the principles of the kernel
Install via Docker
Through Docker, you can avoid the steps of installing MongoDB, which is our most recommended installation method. Before installing ArtiPub with Docker, make sure you have Docker and Docker Compose installed. There are two ways to run ArtiPub with docker.
- Start by docker-compose.yaml
Applicable if you haven't run the mongodb
container locally before . Create a docker-compose.yaml
file in your project directory and enter the following content.
version: "3.3"
services:
app:
image: "tanliyuan123/artipub:1.1.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"
Then enter the following command in the command line. If you want to start the container again, the last content will not be destroyed, remove the volumes
two lines of comments and change it to your own local path.
docker-compose up
Then enter in the browser to http://localhost:8000
see the interface.
Note ⚠️️, if your Docker host is not native, for example, you use Docker Machine or Docker service on another machine, you need to change the environment variable ARTIPUB_API_ADDRESS
to the host IP + port number (default 3000). Then, type in the browser http://< 宿主机 IP>:8000
to see the interface.
- Start the artipub mirror independently
If you already have a mongodb container started locally, you don't want to use the above method to start another one. Which goofy_ganguly
is the name of the locally started mongodb container, just replace it with your local one.
docker run --rm -it --link goofy_ganguly -p 3000:3000/tcp -p 8000:8000/tcp tanliyuan123/artipub:1.0
Install via npm package
If you are familiar with npm and already have a MongoDB environment, this is the quickest way.
Install npm package
npm install -g artipub
When installing the npm package, in order to speed up the download speed, you can add --registry
parameters to set the mirror source (this can also be done when installing the source code later)
npm install -g artipub --registry=https://registry.npm.taobao.org
Run ArtiPub
artipub start
This command will use localhost:27017/artipub
the MongoDB database link by default . Enter the following commands to see more configurations, such as the configuration database.
artipub -h
After successful operation, enter in the browser to http://localhost:8000
see the interface.
Install from source code
Clone Github Repo
git clone https://github.com/crawlab-team/artipub
Install npm package
cd artipub
npm install
Start the front end
npm run start:frontend
Start backend
npm run start:backend
Configuration database
The configuration of the database is ./config.js
in and can be configured according to the situation.
Configure the back-end API address
If the service you deploy is not on this machine, you need ./src/config/config.ts
to apiEndpoint
change it to the corresponding IP address + port in.
principle
Use crawler technology to publish articles to major platforms. ArtiPub's crawler uses Puppeteer, an automated testing tool developed by Google. This tool can not only obtain data that requires ajax dynamic content, but also perform some simulation operations, similar to Selenium, but more powerful. How to log in? In fact, ArtiPub obtains the user login information (Cookie) through the Chrome plug-in, and injects the cookie into the Chromium browser operated by Puppeteer, and then the browser can log in to the website normally to post a message. Cookies are stored in the MongoDB database built by the user and are not exposed to the outside world, so they are very safe.
The following figure is a schematic diagram of ArtiPub's architecture:
A brief introduction to the architecture principle is as follows:
- The backend is the hub of the entire architecture, responsible for exchanging data for the front end, storing and reading databases, controlling crawlers, collecting cookies, etc.;
- The Chrome Extension is only responsible for obtaining cookies from the website (Sites);
- Spiders are controlled by the backend and are responsible for publishing articles and crawling data on the website;
- The database (MongoDB) is responsible for storing data;
- Frontend (Frontend) is a React application, modified from Ant Design Pro.
Why create ArtiPub
Programmers and technicians often write technical articles and blogs for technology sharing, product sharing or consulting, etc. Technical bloggers usually need to publish articles in multiple media channels, such as Nuggets, SegmentFault, CSDN, Zhihu, Jianshu, WeChat Official Accounts, etc., in order to get the most attention. However, publishing articles to so many platforms takes time and effort, and requires constant copying and pasting; at the same time, when the author wants to check the number of readings, he also needs to switch various websites to make statistics. This is very inconvenient. ArtiPub is mainly to solve these problems.
There is already a multi-posting platform on the market, such as OpenWrite, why create ArtiPub? Perhaps other one-text multi-post platforms are also an alternative, but they require users to upload their own account information such as cookies or account passwords to the other party's server, which is very insecure. Once the platform has problems, their account information will be leaked. Although I believe that the general platform will not maliciously operate the user's account, but if there is a misoperation, your account privacy will be leaked, and the property on the platform may also be damaged. There is such a risk that needs to be considered. ArtiPub does not require users to upload account information. All account information is stored in the user's own database, thus avoiding this security risk.
In addition, because ArtiPub is open source, the JS source code is easy to understand and has strong scalability. If users have access to other platforms, they can change the source code to achieve their own needs without waiting for the platform to update. The development team will also continue to develop ArtiPub to make it more practical and easy to use.
Contribute code
Excellent developers are very welcome to contribute to ArtiPub. Before mentioning Pull Request, please read the source code first to understand the principle and architecture. If you don’t understand, you can add the author WeChat tikazyq1 to indicate ArtiPub.