func RecentRelease(c *fiber.Ctx) error { b := make([]string, 0) var tmp RR h := colly.NewCollector() h.OnHTML("div.last_episodes.loaddub > ul > li", func(e *colly.HTMLElement) { es := e.DOM aid, _ := es.Find("p.name > a").Attr("href") a := strings.Split(aid, "/")[1] episodeId := strings.Trim(fmt.Sprint(a), "[]") animeTitle, _ := es.Find("p.name > a").Attr("title") ep := strings.Split(es.Find("p.episode").Text(), "Episode ") episodeNum := strings.Trim(fmt.Sprint(ep), "[]") sdk, _ := es.Find("div > a > div").Attr("class") sd := strings.Split(sdk, "type ic-") subOrDub := strings.Trim(fmt.Sprint(sd), "[]") animeImg, _ := es.Find("div > a > img").Attr("src") epu, _ := es.Find("p.name > a").Attr("href") episodeUrl := base_url + epu tmp = RR{ EpisodeID: episodeId, AnimeTitle: animeTitle, EpisodeNum: episodeNum, Subordub: subOrDub, AnimeImg: animeImg, EpisodeURL: episodeUrl, } dt, _ := json.Marshal(tmp) data := BytesToString(dt) b = append(b, data) }) h.Visit(recent_release_url) js, _ := json.Marshal(b) hello := strings.Replace(string(js), "\\", "", -1) fmt.Println(string(js)) return c.JSON(fiber.Map{ "recent_release": hello, }) }