Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhykos/autophoto
📸 autophoto ✨ A native application to automatically publish your photos
https://github.com/zhykos/autophoto
automation bluesky bot deno native photo screenshot typescript video-game
Last synced: 19 days ago
JSON representation
📸 autophoto ✨ A native application to automatically publish your photos
- Host: GitHub
- URL: https://github.com/zhykos/autophoto
- Owner: Zhykos
- License: mit
- Created: 2024-09-18T17:41:20.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-11-21T19:42:20.000Z (about 2 months ago)
- Last Synced: 2024-11-21T20:30:53.588Z (about 2 months ago)
- Topics: automation, bluesky, bot, deno, native, photo, screenshot, typescript, video-game
- Language: TypeScript
- Homepage: https://bsky.app/profile/galleryvideogames.bsky.social
- Size: 4.78 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# autophoto
An application to automatically publish your photos
Key Features •
How To Use •
Contributing •
Credits •
License •
Projects using autophoto![bluesky](doc/bluesky-post.webp)
## Key Features
* Pre-scan your directory for photos
- Photos are detected by a path pattern
- Check all detected photos if they are valid
* Scan your directory for photos
- For now only suppose to work with video game screenshots
- Photos are detected by a path pattern
* Publish them to a remote server
- Only supports Bluesky
- Randomly select 4 photos and publish them
* Application is build as native desktop app
- CLI based## How To Use
Find the latest release [here](https://github.com/Zhykos/autophoto/releases).
Download the latest release for your platform and run the executable.### To scan your directory for photos
#### Configuration file
First, you need to configure the application to scan your directory for photos with a YAML configuration file.
Example configuration file:
```yaml
autophoto:
scan:
- directory: ./test/resources/video-game
type: video-game
data-pattern:
regex: '^(.+) \((\d{4})\)/(.+)/.+\.webp$'
groups:
- title
- release-year
- platform
```As you can scan multiple directories, you can add multiple `scan` entries.
A `scan` entry has the following properties:
- `directory`: The directory to scan for photos
- `type`: The type of photos to scan for (V1 only supports `video-game`)
- `data-pattern`: The pattern to extract data from the photo path
- `regex`: The regex to match the photo path
- `groups`: The groups to extract from the regex (only the following groups are supported for now: `title`, `release-year`, `platform`)In the example above, the application will scan the `./test/resources/video-game` directory for photos with the following path pattern:
`{video game title} ({release-year})/{platform}/photo-name.webp`#### Run the application to pre-scan (check) your directories
Once you have your configuration file, you can run the application with the configuration file as argument: :
```shell
autophoto --prescan=./path/to/your/configuration-file.yaml
```You'll see the detected photos and if they are valid or not in the console.
#### Run the application to scan your directories
Once you have your configuration file, you can run the application with the configuration file as argument: :
```shell
autophoto --scan=./path/to/your/configuration-file.yaml
```The scanned data are stored in a SQLite database in the `db.autophoto.sqlite3` file.
You can specify a different path for the database file with the `--database` option:```shell
autophoto --scan=./path/to/your/configuration-file.yaml --database=./path/to/your/database-file.sqlite3
```You can also activate the debug mode with the `--debug` option.
This will print the video games and photos detected during the scan:```shell
autophoto --scan=./path/to/your/configuration-file.yaml --debug
```### To publish your photos
You need a Bluesky account to publish your photos: [Bluesky](https://bsky.app/).
Then run the application with the `--publish` option and your Bluesky credentials:
```shell
autophoto --publish --bluesky_login=your_login --bluesky_password=your_password
```You can also specify the path to the database file with the `--database` option:
```shell
autophoto --publish --bluesky_login=your_login --bluesky_password=your_password --database=./path/to/your/database-file.sqlite3
```You can also activate the debug mode with the `--debug` option.
This will print the photos published:```shell
autophoto --publish --bluesky_login=your_login --bluesky_password=your_password --debug
```You can also specify the Bluesky URL with the `--bluesky_host` option:
```shell
autophoto --publish --bluesky_login=your_login --bluesky_password=your_password --bluesky_host=https://bsky.app
```## Contributing
### Install the project
#### Deno
Deno is a runtime for JavaScript and TypeScript that is based on the V8 JavaScript engine and the Rust programming language.
You need to install Deno to run the project: https://docs.deno.com/runtime/getting_started/installation/.
#### Lint and format
Activate the linter and formater with Biome:
```shell
deno add npm:@biomejs/[email protected]
deno install --allow-scripts=npm:@biomejs/[email protected]
```You'll be able to run the lint with the following command (Deno linter and Biome linter will be executed):
```shell
deno task lint
```You'll be able to run the format with the following command (only use Biome formatter):
```shell
deno task format
```#### Git hooks
You can install the git hooks with the following command:
```shell
deno task hook install
```It will run the linter and tests before each commit.
### Run the project
There is no run configuration for the project because I just used unit tests to develop the project.
However you can execute a scan with the following command:
```shell
deno task e2e:scan
```It will use the configuration files `config.yml` and `./test/resources/config2.yml`.
You can execute a publish with the following command:
```shell
LOGIN=your_login PASSWORD=your_password deno task e2e:publish
```### Run the tests
You can run the unit tests with the following command:
```shell
deno task test
```You can run the coverage with the following command:
```shell
deno task coverage
```It will generate a coverage report in the `coverage` directory and open it in your browser.
## Credits
This software uses the following open source packages:
- [Deno 2 - JavaScript runtime](https://deno.com/)
- [Biome - Lint and format](https://biomejs.dev/)
- [JavaScript Standards](https://jsr.io/@std)
- [atproto - For Bluesky](https://atproto.com/)
- [Multiformats](https://multiformats.io/)
- [Hook](https://deno.land/x/deno_hooks)
- [README template](https://github.com/amitmerchant1990)
- I wish to not generate a header with IA so I used an image by eniko kis on Unsplash
- Everyone, somehow, because I used Copilot to help me write the code## Authors
- **Thomas Cicognani** - *Original creator* - [Zhykos](https://github.com/Zhykos)
## License
[MIT](https://opensource.org/license/MIT)
## Projects using autophoto
- [🖼️ Gallery of video games screenshots: more than 10.000 photos](https://bsky.app/profile/galleryvideogames.bsky.social)
---
This project is also a space to learn and experiment with Deno, TypeScript, DDD and TDD.
So, if you have any suggestions, questions or want to chat, feel free to contact me.
Some things already need to be improved, like the error handling, the architecture,
the domains, the performance, etc. So, if you want to help me, I will be happy to work with you.> [zhykos.fr](https://www.zhykos.fr) ·
> GitHub [@zhykos](https://github.com/Zhykos) ·
> Bluesky [@zhykos](https://bsky.app/profile/zhykos.bsky.social)