https://github.com/danielrosehill/better-hashnode-backups
Backups a Hashnode blog including the images from the CDN
https://github.com/danielrosehill/better-hashnode-backups
backup-script backups hashnode
Last synced: 10 months ago
JSON representation
Backups a Hashnode blog including the images from the CDN
- Host: GitHub
- URL: https://github.com/danielrosehill/better-hashnode-backups
- Owner: danielrosehill
- Created: 2025-01-12T10:28:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-12T10:41:54.000Z (about 1 year ago)
- Last Synced: 2025-03-11T12:57:59.781Z (10 months ago)
- Topics: backup-script, backups, hashnode
- Language: Python
- Homepage:
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hashnode Backup Script With Images
## The Problem
[Hashnode](https://www.hashnode.com) is a great blogging service and has a nice Github action for syncing your posts to a repository as a backup mechanism. However, at the time of writing, the backup mechanism does not extract the images from the CDN.
I "wrote" this backup script using Claude Sonnet 3.5 and after a few iterations I got it to work.
The script will copy your Hashnode blog posts over to a target directory and pulls the images out of the CDN (to prevent it attempting to copy SVGs, I added some specificity for the type of file it would regard as an image; If you use SVGs commonly for images, then modify the script.).
## File Structure
- For every post a folder is create (1)
- Images is created as a subfolder.
- The extracted images are nested within it.
- The post itself is written to `index.md`So I do not have that flag.

## How To Run
- Copy the script (`backup-script.py`)
- Rename `example.env` as `.env`
- Replace it with your values.
You'll need your Hashnode token.
## Suggested Usage
One possible backup strategy to make sure that your Hashnode posts are being backed up regularly:
- Clone this repository onto your server.
- Edit values as above
- Run the Python program as a Cron job according to your desired backup frequency.
## Use Case Statement
## Author
Daniel Rosehill
(public at danielrosehill dot com)
## Licensing
This repository is licensed under CC-BY-4.0 (Attribution 4.0 International)
[License](https://creativecommons.org/licenses/by/4.0/)
### Summary of the License
The Creative Commons Attribution 4.0 International (CC BY 4.0) license allows others to:
- **Share**: Copy and redistribute the material in any medium or format.
- **Adapt**: Remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
#### License Terms
- **Attribution**: You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- **No additional restrictions**: You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
For the full legal code, please visit the [Creative Commons website](https://creativecommons.org/licenses/by/4.0/legalcode).