Добавил настройку отображения
This commit is contained in:
parent
9fa91004bf
commit
4f998a2730
5 changed files with 10 additions and 5 deletions
|
|
@ -23,8 +23,10 @@ instance: https://pleroma.catgirls.asia #Адрес инстанса
|
|||
rss_urls: #YAML массив лент
|
||||
- url: https://habr.com/ru/rss/flows/admin/articles/?fl=ru #Адрес ленты
|
||||
sensitive: false #Нужно ли ставить NSFW плашку
|
||||
visibility: "unlisted" #Режим отображения постов. Есть public, unlisted, private, direct
|
||||
- url: https://4pda.to/feed
|
||||
sensitive: false
|
||||
visibility: "unlisted"
|
||||
redis:
|
||||
address: localhost:6379 #Адрес Redis, в случае использования Docker Compose необходимо написать redis:6379
|
||||
```
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ instance: https://pleroma.catgirls.asia
|
|||
rss_urls:
|
||||
- url: https://habr.com/ru/rss/flows/admin/articles/?fl=ru
|
||||
sensitive: false
|
||||
visibility: "unlisted"
|
||||
- url: https://4pda.to/feed
|
||||
sensitive: false
|
||||
visibility: "unlisted"
|
||||
redis:
|
||||
address: localhost:6379
|
||||
|
|
@ -12,8 +12,9 @@ import (
|
|||
type KikiSettings struct {
|
||||
Instance string `yaml:"instance,omitempty"`
|
||||
RSSURLs []struct {
|
||||
Url string `yaml:"url,omitempty"`
|
||||
Sensitive bool `yaml:"sensitive,omitempty"`
|
||||
Url string `yaml:"url,omitempty"`
|
||||
Sensitive bool `yaml:"sensitive,omitempty"`
|
||||
Visibility string `yaml:"visibility"`
|
||||
} `yaml:"rss_urls,omitempty"`
|
||||
Redis struct {
|
||||
Address string `yaml:"address"`
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ func main() {
|
|||
if !inStack {
|
||||
log.Println(post.Description)
|
||||
|
||||
toot, err := tooter.CreateToot(*mastoClient, post, rssUrl.Sensitive)
|
||||
toot, err := tooter.CreateToot(*mastoClient, post, rssUrl.Sensitive, rssUrl.Visibility)
|
||||
if err != nil {
|
||||
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) (mastodon.Toot, error) {
|
||||
func CreateToot(mastoClient mastodon.Client, newsDesc *gofeed.Item, sensitive bool, visibility string) (mastodon.Toot, error) {
|
||||
var imgArray []string
|
||||
var attachments []*mastodon.Attachment
|
||||
|
||||
var tootText string = fmt.Sprintf("src: %s\n\n", newsDesc.Link)
|
||||
|
||||
toot := mastodon.Toot{
|
||||
Visibility: "unlisted",
|
||||
Visibility: visibility,
|
||||
Sensitive: sensitive,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue