Compare commits
No commits in common. "master" and "multi_feed" have entirely different histories.
master
...
multi_feed
8 changed files with 7 additions and 23 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -19,7 +19,6 @@ config.yaml
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
*.out
|
*.out
|
||||||
kiki
|
kiki
|
||||||
redis_data
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
# Dependency directories (remove the comment below to include it)
|
||||||
# vendor/
|
# vendor/
|
||||||
|
|
||||||
|
|
|
||||||
12
Dockerfile
12
Dockerfile
|
|
@ -1,6 +1,4 @@
|
||||||
FROM golang:1.24-alpine AS build
|
FROM golang:1.24
|
||||||
|
|
||||||
RUN apk add --no-cache make
|
|
||||||
|
|
||||||
WORKDIR /app/kiki
|
WORKDIR /app/kiki
|
||||||
|
|
||||||
|
|
@ -16,12 +14,4 @@ COPY Makefile /app/kiki/
|
||||||
|
|
||||||
RUN make
|
RUN make
|
||||||
|
|
||||||
FROM alpine:latest
|
|
||||||
|
|
||||||
WORKDIR /app/kiki/
|
|
||||||
|
|
||||||
COPY --from=build /app/kiki/kiki /app/kiki/kiki
|
|
||||||
|
|
||||||
RUN chmod +x /app/kiki/kiki
|
|
||||||
|
|
||||||
CMD [ "/app/kiki/kiki", "run" ]
|
CMD [ "/app/kiki/kiki", "run" ]
|
||||||
|
|
@ -23,10 +23,8 @@ instance: https://pleroma.catgirls.asia #Адрес инстанса
|
||||||
rss_urls: #YAML массив лент
|
rss_urls: #YAML массив лент
|
||||||
- url: https://habr.com/ru/rss/flows/admin/articles/?fl=ru #Адрес ленты
|
- url: https://habr.com/ru/rss/flows/admin/articles/?fl=ru #Адрес ленты
|
||||||
sensitive: false #Нужно ли ставить NSFW плашку
|
sensitive: false #Нужно ли ставить NSFW плашку
|
||||||
visibility: "unlisted" #Режим отображения постов. Есть public, unlisted, private, direct
|
|
||||||
- url: https://4pda.to/feed
|
- url: https://4pda.to/feed
|
||||||
sensitive: false
|
sensitive: false
|
||||||
visibility: "unlisted"
|
|
||||||
redis:
|
redis:
|
||||||
address: localhost:6379 #Адрес Redis, в случае использования Docker Compose необходимо написать redis:6379
|
address: localhost:6379 #Адрес Redis, в случае использования Docker Compose необходимо написать redis:6379
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,7 @@ instance: https://pleroma.catgirls.asia
|
||||||
rss_urls:
|
rss_urls:
|
||||||
- url: https://habr.com/ru/rss/flows/admin/articles/?fl=ru
|
- url: https://habr.com/ru/rss/flows/admin/articles/?fl=ru
|
||||||
sensitive: false
|
sensitive: false
|
||||||
visibility: "unlisted"
|
|
||||||
- url: https://4pda.to/feed
|
- url: https://4pda.to/feed
|
||||||
sensitive: false
|
sensitive: false
|
||||||
visibility: "unlisted"
|
|
||||||
redis:
|
redis:
|
||||||
address: localhost:6379
|
address: localhost:6379
|
||||||
|
|
@ -14,7 +14,6 @@ type KikiSettings struct {
|
||||||
RSSURLs []struct {
|
RSSURLs []struct {
|
||||||
Url string `yaml:"url,omitempty"`
|
Url string `yaml:"url,omitempty"`
|
||||||
Sensitive bool `yaml:"sensitive,omitempty"`
|
Sensitive bool `yaml:"sensitive,omitempty"`
|
||||||
Visibility string `yaml:"visibility"`
|
|
||||||
} `yaml:"rss_urls,omitempty"`
|
} `yaml:"rss_urls,omitempty"`
|
||||||
Redis struct {
|
Redis struct {
|
||||||
Address string `yaml:"address"`
|
Address string `yaml:"address"`
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
services:
|
services:
|
||||||
kiki:
|
kiki:
|
||||||
image: git.catgirls.asia/b4d_us3r/kiki:latest
|
build: ./
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.yaml:/app/kiki/config.yaml
|
- ./config.yaml:/app/kiki/config.yaml
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ func main() {
|
||||||
if !inStack {
|
if !inStack {
|
||||||
log.Println(post.Description)
|
log.Println(post.Description)
|
||||||
|
|
||||||
toot, err := tooter.CreateToot(*mastoClient, post, rssUrl.Sensitive, rssUrl.Visibility)
|
toot, err := tooter.CreateToot(*mastoClient, post, rssUrl.Sensitive)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -154,14 +154,14 @@ func UploadPictures(mastoClient mastodon.Client, filesBytes [][]byte) []*mastodo
|
||||||
}
|
}
|
||||||
|
|
||||||
// Формирование тела статуса
|
// Формирование тела статуса
|
||||||
func CreateToot(mastoClient mastodon.Client, newsDesc *gofeed.Item, sensitive bool, visibility string) (mastodon.Toot, error) {
|
func CreateToot(mastoClient mastodon.Client, newsDesc *gofeed.Item, sensitive bool) (mastodon.Toot, error) {
|
||||||
var imgArray []string
|
var imgArray []string
|
||||||
var attachments []*mastodon.Attachment
|
var attachments []*mastodon.Attachment
|
||||||
|
|
||||||
var tootText string = fmt.Sprintf("src: %s\n\n", newsDesc.Link)
|
var tootText string = fmt.Sprintf("src: %s\n\n", newsDesc.Link)
|
||||||
|
|
||||||
toot := mastodon.Toot{
|
toot := mastodon.Toot{
|
||||||
Visibility: visibility,
|
Visibility: "unlisted",
|
||||||
Sensitive: sensitive,
|
Sensitive: sensitive,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue