47 lines
799 B
Go
47 lines
799 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
"net/url"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
var err error
|
||
|
|
||
|
}
|
||
|
|
||
|
func download(url string) ([]byte, error) {
|
||
|
log.Println("url", url)
|
||
|
return os.ReadFile("ounapuu.xml")
|
||
|
}
|
||
|
|
||
|
func parseFeed(data []byte) ([]string, error) {
|
||
|
return []string{"https://blog.link"}, nil
|
||
|
}
|
||
|
|
||
|
func alreadySent(link string) bool {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
func sendTelegram(link string, channel string, rhash string) error {
|
||
|
log.Println("link", link, "channel", channel, "rhash", rhash)
|
||
|
rhash = "ae86262f2de32f"
|
||
|
log.Println("ivurl", genIVLink(link, rhash))
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func genIVLink(link, rhash string) string {
|
||
|
query := url.Values{}
|
||
|
query.Set("url", link)
|
||
|
query.Set("rhash", rhash)
|
||
|
u := url.URL{
|
||
|
Scheme: "https",
|
||
|
Host: "t.me",
|
||
|
Path: "iv",
|
||
|
RawQuery: vs.Encode(),
|
||
|
}
|
||
|
return u.String()
|
||
|
}
|