Skip to content

Commit

Permalink
refactoring (#11) - resolve #6
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaddeusJiang authored Sep 6, 2024
1 parent f70c1c6 commit a3fc245
Show file tree
Hide file tree
Showing 31 changed files with 69 additions and 513 deletions.
2 changes: 1 addition & 1 deletion .formatter.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
inputs: [
"{mix,.formatter}.exs",
"{config,lib,test}/**/*.{ex,exs}",
".local/**/*.{ex,exs}"
"_local/**/*.{ex,exs}"
]
]
21 changes: 0 additions & 21 deletions .github/workflows/fly.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ erl_crash.dump
*.ez

# Ignore package tarball (built via "mix hex.build").
aier_bot-*.tar
save_it-*.tar

# Temporary files, for example, from tests.
/tmp/
Expand All @@ -30,5 +30,5 @@ dev.sh
start.sh
run.sh
nohup.out
.env
.local

_local
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
# AierBot
# save_it

A telegram bot to sync messages to https://aier.app
A telegram bot who save what you love in internet.

![save memo to AIer.app](./docs/assets/save-memo-to-aier.gif)
## supported services

- [x] https://x.com/
- [x] https://instagram.com/
- [x] https://www.youtube.com/
- [x] https://www.pinterest.com/

## Usage

Just send the link to the bot.

## Build with

- [Elixir](https://elixir-lang.org/)
- [ex_gram](https://github.com/rockneurotiko/ex_gram)

## Usage

TODO:
- [cobalt api](https://github.com/imputnet/cobalt/blob/current/docs/api.md)

## Development

```sh
# install
mix deps.get
```

```sh
# run
export TELEGRAM_BOT_TOKEN=
export AIER_API_TOKEN=
export OPENAI_API_KEY=
export GOOGLE_OAUTH_CLIENT_ID=
export GOOGLE_OAUTH_CLIENT_SECRET=

mix run --no-halt
iex -S mix run --no-halt
```

## Deployment

### CI/CD

GitHub Actions

Secrets:

- `TELEGRAM_BOT_TOKEN`
- `AIER_API_TOKEN`
- `FLY_API_TOKEN`
7 changes: 3 additions & 4 deletions config/runtime.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import Config

config :aier_bot, :telegram_bot_token, System.fetch_env!("TELEGRAM_BOT_TOKEN")
config :aier_bot, :aier_api_token, System.fetch_env!("AIER_API_TOKEN")
config :aier_bot, :openai_api_key, System.fetch_env!("OPENAI_API_KEY")

config :save_it, :telegram_bot_token, System.fetch_env!("TELEGRAM_BOT_TOKEN")
config :ex_gram, token: System.fetch_env!("TELEGRAM_BOT_TOKEN")
config :save_it, :google_oauth_client_id, System.fetch_env!("GOOGLE_OAUTH_CLIENT_ID")
config :save_it, :google_oauth_client_secret, System.fetch_env!("GOOGLE_OAUTH_CLIENT_SECRET")
11 changes: 0 additions & 11 deletions docs/README.md

This file was deleted.

Binary file removed docs/assets/save-memo-to-aier.gif
Binary file not shown.
Binary file removed docs/assets/savt_it_bot_logo.jpeg
Binary file not shown.
Binary file removed docs/bug_log_发送20分钟长视频.png
Binary file not shown.
220 changes: 0 additions & 220 deletions docs/dev-log.md

This file was deleted.

21 changes: 0 additions & 21 deletions docs/dev_readme.md

This file was deleted.

Binary file removed docs/error_log_download_youtube_big_video.png
Binary file not shown.
Binary file not shown.
Binary file removed docs/error_log_streaming_data.png
Binary file not shown.
Binary file removed docs/ex_gram_input.png
Binary file not shown.
Binary file removed docs/file_faster_than_db.png
Binary file not shown.
16 changes: 0 additions & 16 deletions docs/ideas.md

This file was deleted.

Loading

0 comments on commit a3fc245

Please sign in to comment.