Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
MarlikAlmighty committed May 30, 2022
1 parent 09907d5 commit 3c4102c
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions internal/app/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ func (core *Core) Run() {
return
}

if rm, err = core.checkLink(rm); err != nil {
log.Println("[ERROR] check link: " + err.Error())
return
}

log.Printf("check links after from rzn: %v\n", len(rm))

data := models.Array{}
if data, err = core.catchPostFromRzn(rm); err != nil {
log.Println("[ERROR] catch post from rzn: " + err.Error())
Expand All @@ -114,13 +107,6 @@ func (core *Core) Run() {
return
}

if ym, err = core.checkLink(ym); err != nil {
log.Println("[ERROR] check link: " + err.Error())
return
}

log.Printf("check links after from ya: %v\n", len(ym))

data := models.Array{}
if data, err = core.catchPostFromYa(ym); err != nil {
log.Println("[ERROR] catch post from ya: " + err.Error())
Expand Down Expand Up @@ -166,26 +152,6 @@ func (core *Core) browser(url string) (string, error) {
return html, nil
}

func (core *Core) checkLink(m map[string]string) (map[string]string, error) {

var (
hash string
err error
)

mp := make(map[string]string)

for k, v := range m {
hash = core.getMD5Hash(k)
if _, err = core.Store.Get(context.Background(), hash).Result(); err == redis.Nil {
mp[k] = v
} else if err != nil {
return nil, err
}
}
return mp, nil
}

func (core *Core) getLinkRzn() (map[string]string, error) {

if core.Config.(*config.Configuration).RznUrl == "" {
Expand Down Expand Up @@ -384,8 +350,6 @@ func (core *Core) checkPreSend(arr models.Array) error {

//if len(keyWord) > 0 {

time.Sleep(1 * time.Second)

if err = core.sendToTelegram(*v); err != nil {
return err
}
Expand Down

0 comments on commit 3c4102c

Please sign in to comment.