https://github.com/tsubasaogawa/flickr-s3-sync-in-blog
flickr-s3-sync-in-blog helps you migrate from Flickr.
https://github.com/tsubasaogawa/flickr-s3-sync-in-blog
aws-s3 flickr migration
Last synced: 2 months ago
JSON representation
flickr-s3-sync-in-blog helps you migrate from Flickr.
- Host: GitHub
- URL: https://github.com/tsubasaogawa/flickr-s3-sync-in-blog
- Owner: tsubasaogawa
- License: mit
- Created: 2023-06-30T14:57:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T13:22:36.000Z (about 1 year ago)
- Last Synced: 2025-03-02T22:02:17.724Z (3 months ago)
- Topics: aws-s3, flickr, migration
- Language: Go
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flickr-s3-sync-in-blog (fssync)
flickr-s3-sync-in-blog helps you migrate from Flickr.
## Features
- Copy images in the blog post from Flickr to S3
- Replace Flickr URLs with S3 URLs in the blog post
- Remove some tags and attributes used by Flickr, such as `data-flickr-embed`, `client-code.js`### For example
Before
```html
```
Run `fssync`
```bash
./fssync -config=fssync.toml /home/ipsum/entry/2024/04/24/123456.md2024/04/24 22:16:26 Load: /home/ipsum/entry/2024/04/24/123456.md
2024/04/24 22:16:27 Upload: 56789_123abc456def_c.jpg
2024/04/24 22:16:27 Backup: /home/ipsum/blog_backups/2024/04/24/123456.md.bak
2024/04/24 22:16:27 Save: /home/ipsum/entry/2024/04/24/123456.md
```After
```bash
aws s3 ls s3://your.s3bucket.com/56789_123abc456def_c.jpg
# -> File exists
```## Install
Download the binary from the [release](https://github.com/tsubasaogawa/flickr-s3-sync-in-blog/releases) page.
## Configuration
Open and edit `fssync.toml`.
## Usage
```bash
./fssync -config=fssync.toml -dryrun=true
````fssync` with dryrun mode will not upload an image or modify a blog file. It outputs replaced blog texts to stdout.
After your check, you can run it without dryrun option.
```bash
./fssync -config=fssync.toml
```## Tips
### Run fssync to multiple blog posts
`find` is useful.
```bash
find -name '*.md' -type f -print0 | xargs -0 -n1 ./fssync -config=fssync.toml
```### For hatenablog using [blogsync](https://github.com/x-motemen/blogsync)
```bash
# Pull all blog posts
blogsync pull# Run fssync with dryrun mode
cd
./fssync -config=fssync.toml -dryrun=true# Run fssync for all posts in 2024
find -wholename '**/2024/*.md' -type f -print0 | xargs -0 -n1 ./fssync -config=fssync.toml# Push modified blog posts (in 5 minutes)
find -name '*.md' -mmin -5 -type f -print0 | xargs -0 -n1 blogsync push
```