Automated task execution: Fetch articles from a specified column of a specified user on Juejin, and update the article directory link to GitHub pages.
Automated run time: Around 16:20 Beijing time.
Project name: Automated Article Synchronization Platform (auto-sync-blog)
Function: Achieve daily automatic synchronization of data (article titles and links) on writing platforms (such as Juejin, CSDN, JianShu, etc.); at the same time, categorize articles in a user-friendly manner, and provide a more intuitive browsing experience for articles written over the years. (Currently only supports synchronization of the Juejin platform, others are under development.)
Involved technologies: github actions, github pages, node, vuepress
-
Repository -> Settings -> Secrets -> New repository secret, add Secrets variables as follows:
Name Value Required JUEJIN_USER_ID Juejin user id Yes JUEJIN_COLUMN_ID Juejin column id Optional PRESS_TOKEN_TEA_BLOG GitHub Personal access tokens, used to push to the repository, synchronize GitHub pages Yes -
Update the repository's actions permissions: Settings -> Secret -> Actions -> General -> Workflow permissions -> Check Read and write permissions -> Save.
-
Repository -> Actions, check Workflows and enable them.
-
Settings -> Pages -> Branch -> gh-pages (If the gh-pages branch does not appear, repeat the fourth step and check if it has been completed.) -> Save
- Execute the main entry, generate vuepress related configuration (where juejin_user_id corresponds to a string of numbers after user/ on the personal homepage of Juejin)
node .\main.js --juejin_user_id=2819602825362840 --juejin_column_id=7140398633710518302
- Install dependencies
npm install
- Start the project
npm start
- Visit the address
http://localhost:8080/
./
├─main.js // Main entry
├─package-lock.json
├─package.json // Related dependencies and startup methods
├─README.md // Introduction
├─Q&A.md // Problem statistics and solutions
├─public // Main part
| ├─z-test // Test
| | └test.js
| ├─utils // Method calls
| | ├─ArticleUtils. // Article data processing
| | ├─DateUtils.js // Time processing
| | ├─FileUtils.js // File processing
| | ├─Http.js // Request
| | ├─minimist.js // Node parameter processing
| | └VuepressUtils.js // Generate vuepress related configuration
| ├─template // Template
| | ├─vuepress // Template for generating vuepress related configuration
| | | ├─config-template.js
| | | └readme-template.md
| | ├─article // Template for generating markdown files
| | | ├─all-template.md
| | | ├─year-month-template.md
| | | └year-template.md
| ├─src // Main entry of the main part
| | └catch-main.js
| ├─base // Basic data
| | ├─base-data.js // Static data
| | └cover.jpg // Static image
├─docs // Below are the folders and files generated after executing node locally
| ├─README.md // Vuepress related configuration
| ├─sort // Main markdown files
| | ├─all.md
| | ├─2023
| | | ├─2023.md
| | | ├─202301.md
| | | └202302.md
| | ├─2022
| | | ├─2022.md
| | | └202201.md
| ├─.vuepress // Vuepress related configuration
| | ├─config.js
| | ├─public
| | | └cover.jpg
- Implement multiple columns (specify multiple columns, all columns of specified users)
- Implement favorite classification (specify collection)
- Implement email subscription (send to subscribed email when updated)
- Implement more flexible vuepress configuration files (easier to modify, etc.)
- Implement support for more platform synchronization (such as CSDN, JianShu, etc.)
- Implement more convenient configurations (Baidu statistics, weather, music)
南方者 |
Ylimhs |
南方者 |
欢迎各位英雄豪杰加入,共建更完美的 自动化同步文章平台(auto-sync-blog) 。
auto-sync-blog is under the GPL license.