# Open link/DL file

**URL:** <https://rubytalk.org/t/open-link-dl-file/39764>\
**Category:** ruby-talk\
**Created:** [9 August 2007 00:19 UTC](https://rubytalk.org/t/open-link-dl-file/39764 "2007-08-09T00:19:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erik\_Boling](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@Erik\_Boling](https://rubytalk.org/u/Erik_Boling)\
**Post date:** [9 August 2007 00:19 UTC](https://rubytalk.org/t/open-link-dl-file/39764/1 "2007-08-09T00:19:56Z")

</div>

I was wondering what the command is for Ruby to DL files, and or open  
links on the internet?My favorite radio station has this link that feeds  
you the live radio via- real player or windows media player. My goal is  
to be able to write a program that downloads a live feed from a radio  
station that i like to listen to,  
then i could put the program on schedule tasks and you that as my alarm  
clock. \*If your wondering, no i cant just go get a radio, i dont get  
that station where i am at\*  
Much thanks for any help!🙂

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Roger\_Pack4](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Roger\_Pack4](https://rubytalk.org/u/Roger_Pack4)\
**Post date:** [9 August 2007 02:02 UTC](https://rubytalk.org/t/open-link-dl-file/39764/2 "2007-08-09T02:02:24Z")

</div>

look up open-uri  
Erik Boling wrote:

> **···**
>
> > I was wondering what the command is for Ruby to DL files, and or open  
> > links on the internet?My favorite radio station has this link that feeds  
> > you the live radio via- real player or windows media player. My goal is  
> > to be able to write a program that downloads a live feed from a radio  
> > station that i like to listen to,  
> > then i could put the program on schedule tasks and you that as my alarm  
> > clock. \*If your wondering, no i cant just go get a radio, i dont get  
> > that station where i am at\*  
> > Much thanks for any help!🙂
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Erik\_Boling](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@Erik\_Boling](https://rubytalk.org/u/Erik_Boling)\
**Post date:** [9 August 2007 02:52 UTC](https://rubytalk.org/t/open-link-dl-file/39764/3 "2007-08-09T02:52:00Z")

</div>

Roger Pack wrote:

> look up open-uri

Well i have tried looking that up on google, and other different key  
words, but still i cant get what i'm looking for. It's all talking about  
reading from the web page and putting into to hashes and what not. I  
just want to open the web page.  
I tried doing,  
require 'open-uri'  
open('[http://kexp.org/audio/kexp.wmx&#39;\](http://kexp.org/audio/kexp.wmx&#39;%5C))  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this is what i thought you should do, but all the sites have all  
this other fancy code in there so i'm not sure?  
if you type this in on address bar it works  
but nothing happens when i try and write it like that:(?  
Any more suggestions?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Prime](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@Prime](https://rubytalk.org/u/Prime)\
**Post date:** [9 August 2007 04:59 UTC](https://rubytalk.org/t/open-link-dl-file/39764/4 "2007-08-09T04:59:58Z")

</div>

I think if I understand you correctly you just want to open the link in a browser instance?  
if you are on windows you might want to check this out:

> **[Automating Internet Explorer with Ruby: Watir](http://rubyonwindows.blogspot.com/2007/05/automating-internet-explorer-with-ruby.html)**
>
> A reader has asked about automating Internet Explorer (IE) with Ruby. While you can do this using the win32ole library, I strongly recommen...

or

if you are on a mac  
`open [http://kexp.org/audio/kexp.wmx\`](http://kexp.org/audio/kexp.wmx%5C%60)  
this will open the page in your default browser.

> **···**
>
> On 2007-08-08 19:52:00 -0700, Erik Boling \<schmode93@yahoo.com\> said:
> 
> > Roger Pack wrote:
> > 
> > > look up open-uri
> > 
> > Well i have tried looking that up on google, and other different key  
> > words, but still i cant get what i'm looking for. It's all talking about  
> > reading from the web page and putting into to hashes and what not. I  
> > just want to open the web page.  
> > I tried doing,  
> > require 'open-uri'  
> > open('[http://kexp.org/audio/kexp.wmx&#39;\](http://kexp.org/audio/kexp.wmx&#39;%5C))  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this is what i thought you should do, but all the sites have all  
> > this other fancy code in there so i'm not sure?  
> > if you type this in on address bar it works  
> > but nothing happens when i try and write it like that:(?  
> > Any more suggestions?

---

<div class="post-metadata">

**Author:** ![Erik\_Boling](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@Erik\_Boling](https://rubytalk.org/u/Erik_Boling)\
**Post date:** [10 August 2007 04:23 UTC](https://rubytalk.org/t/open-link-dl-file/39764/5 "2007-08-10T04:23:21Z")

</div>

Prime wrote:

> I think if I understand you correctly you just want to open the link in  
> a browser instance?  
> if you are on windows you might want to check this out:

I'm not sure if I'm totally lost on how to install the gem watir? I  
download the gem, but then to you have to install it i guess in cmd from  
what I'm reading online. so i save the watir.gem in "c" drive and type  
in on cmd  
C:\\>gem install watir  
but i get this message saying that gem is not a recognizable command?  
what am i doing wrong?  
On a side note, i don't have a very clear idea of what ruby gems is  
\*exactly\* does any one know of any good sites to explain what it all is?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Prime](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@Prime](https://rubytalk.org/u/Prime)\
**Post date:** [10 August 2007 04:45 UTC](https://rubytalk.org/t/open-link-dl-file/39764/6 "2007-08-10T04:45:03Z")

</div>

A gem is...  
[http://rubygems.org/read/chapter/1#page22](http://rubygems.org/read/chapter/1#page22)

> **···**
>
> On 2007-08-09 21:23:21 -0700, Erik Boling \<schmode93@yahoo.com\> said:
> 
> > Prime wrote:
> > 
> > > I think if I understand you correctly you just want to open the link in  
> > > a browser instance?  
> > > if you are on windows you might want to check this out:
> > 
> > I'm not sure if I'm totally lost on how to install the gem watir? I  
> > download the gem, but then to you have to install it i guess in cmd from  
> > what I'm reading online. so i save the watir.gem in "c" drive and type  
> > in on cmd  
> > C:\\>gem install watir  
> > but i get this message saying that gem is not a recognizable command?  
> > what am i doing wrong?  
> > On a side note, i don't have a very clear idea of what ruby gems is  
> > \*exactly\* does any one know of any good sites to explain what it all is?

---

<div class="post-metadata">

**Author:** ![Erik\_Boling](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@Erik\_Boling](https://rubytalk.org/u/Erik_Boling)\
**Post date:** [10 August 2007 14:24 UTC](https://rubytalk.org/t/open-link-dl-file/39764/7 "2007-08-10T14:24:18Z")

</div>

Prime wrote:

> A gem is...  
> [http://rubygems.org/read/chapter/1#page22](http://rubygems.org/read/chapter/1#page22)

Ah, thanks, thats funny i just found that site before i read you post  
:P.

now does anyone know what i'm doing wrong when i'm installing this gem?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
