31 lines
654 B
Go
31 lines
654 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"goclock/dict"
|
|
"goclock/weather"
|
|
"log"
|
|
"os/exec"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
now := time.Now()
|
|
|
|
day := now.Day()
|
|
month := now.Month().String()
|
|
weekday := now.Weekday().String()
|
|
hour := now.Hour()
|
|
minute := now.Minute()
|
|
|
|
timeStr := dict.WeekdayRussian(weekday) + " " + dict.DayRussian(day) + " " + dict.MonthRussian(month) + " " + dict.HourRussian(hour) + " " + dict.MinuteRussian(minute)
|
|
strWeather := weather.CompilationWeatherString("KUM")
|
|
|
|
command := exec.Command("sh", "-c", fmt.Sprintf("echo '%s' | RHVoice-test -p Anna", timeStr+" "+strWeather))
|
|
|
|
err := command.Run()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|