cmd.init   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
package cmd
2
3
import (
4
	"github.com/SerhiiCho/shoshka-go/telegram"
5
6
	"github.com/spf13/cobra"
7
)
8
9
var titlesCmd = &cobra.Command{
10
	Use:   "titles",
11
	Short: "Checks new photo reports at specific target site by parsing html and checking if there are new posts added. If new added, it takes the title, link and image url and sends it to a telegram chat.",
12
	Run: func(cmd *cobra.Command, args []string) {
13
		for _, msg := range telegram.GetMessagesWithNewReports() {
14
			telegram.SendMessage(msg)
15
		}
16
	},
17
}
18
19
func init() {
20
	rootCmd.AddCommand(titlesCmd)
21
}
22