Forum: Ruby URL Content in Variable

A4162c8ddcdc932001aca326b1f3eeca?d=identicon&s=25 Max Lurch (audio007)
on 2017-03-15 13:55
Hello,
i want ruby to take the Content from a Website an write this in a
variable.
Can somebody help me?
Greetz
0026dd77fd9ecc97b36e5b79cdbcf590?d=identicon&s=25 R. Kumar (sentinel)
on 2017-03-15 14:58
Max Lurch wrote in post #1185688:
> Hello,
> i want ruby to take the Content from a Website an write this in a
> variable.
> Can somebody help me?
> Greetz

http://stackoverflow.com/questions/3193538/retriev...

basically:

  open("http://www.ruby-lang.org/") {|f|
    f.each_line {|line| p line}
  }

You can append the contents to a string or array within the loop.

See the docs at:
https://ruby-doc.org/stdlib-2.1.0/libdoc/open-uri/...

If it's a website, you probably want to use the nokogiri gem to parse
the content and get exactly what you want.
A4162c8ddcdc932001aca326b1f3eeca?d=identicon&s=25 Max Lurch (audio007)
on 2017-03-15 15:28
Is where any way to do this with a Website which is opend by an android
device?
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.