Хотел было забрать блог difrex, но:
$ curl https://dynamic.lessmore.pw/idec/u/e/difrex.blog difrex.blog error: Internal error
ping II/IDEC networks :: idec.talks :: Сеть IDEC / Что с станцией lessmore? | Contacts :: Login |
$ curl https://dynamic.lessmore.pw/idec/u/e/difrex.blog difrex.blog error: Internal error
curl https://dynamic.lessmore.pw/idec/u/e/difrex.blog/-250:250 difrex.blog 2fDZ67P8JkchA9Rh4If4 2NszlFTgvhakzz7dIfvc ML8cpSyzyOKaFA6Lx1NF 8TtPHu5T7oo3GSXdDYc5 U6ZYZxgYz2sq01L96zZz igt9lCsui5qE9AICtdgP mTWsJXVOAljita3sgDOK V0hj3Z0QjFxpluaaiKvI b91aGfRgRLJWfB1q60bg pNfzXBddGbSy7AW7slpz 4fmEizz5kjk4UcQf7VIJ OxdmEiQJIZqrqjCUNp2i ojRAXNp7wzVIF9GBetZn z5UV57mUeyhAmFsaMUq0
messages := make(map[string][]string) echoList := strings.Split(getBody(resp.Body)) var currentEcho string for i := range echoList { if echoList[i] == "" { continue } if isEcho(echoList[i]) { currentEcho = echoList[i] } if isMessage(echoList[i]) { messages[currentEcho] = append(messages[currentEcho], echoList[i]) } }
func http_req_lines(url string, fn func(string) bool) error { resp, err := http.Get(url) if err != nil { return err } defer resp.Body.Close() reader := bufio.NewReader(resp.Body) for { line, err := reader.ReadString('\n') if err != nil && err != io.EOF { return err } line = strings.TrimSuffix(line, "\n") if err == io.EOF { break } if !fn(line) { break } } return nil }
if err == io.EOF { if line != "" { /* no eol in last line? broken node? */ fn(line) } break }