Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v
/
examples
/
links_scraper.v
11
lines
·
10
sloc
·
244 bytes
·
951d30405f894991c8277a4fa13c03dad1b69591
Raw
1
import
net.http
2
3
fn
main() {
4
html := http.get_text(
'https://news.ycombinator.com'
)
5
mut
pos := 0
6
for
{
7
pos = html.index_after(
'https://'
, pos + 1)
or
{
break
}
8
end := html.index_after(
'"'
, pos)
or
{
break
}
9
println(html[pos..end])
10
}
11
}
12