[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

download a comic strip and email to myself with Ruby?

SpringFlowers AutumnMoon

5/26/2009 8:54:00 AM

using Ruby on my local Windows machine, can I easily write a script to
download a comic strip every day and email it to myself?

such as
http://comics.c...
--
Posted via http://www.ruby-....

7 Answers

Andrew Timberlake

5/26/2009 9:03:00 AM

0

On Tue, May 26, 2009 at 10:54 AM, SpringFlowers AutumnMoon
<blueskybreeze@gmail.com> wrote:
> using Ruby on my local Windows machine, can I easily write a script to
> download a comic strip every day and email it to myself?
>
> such as
> http://comics.c...

Yes

Andrew Timberlake
http://ramblingso...

http://MyM... - The SIMPLE way to manage your savings

SpringFlowers AutumnMoon

5/26/2009 6:44:00 PM

0

Andrew Timberlake wrote:
> On Tue, May 26, 2009 at 10:54 AM, SpringFlowers AutumnMoon
> <blueskybreeze@gmail.com> wrote:
>> using Ruby on my local Windows machine, can I easily write a script to
>> download a comic strip every day and email it to myself?
>>
>> such as
>> http://comics.c...
>
> Yes

how is it done?
--
Posted via http://www.ruby-....

imphasing

5/26/2009 6:58:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

I would use Hpricot to parse the HTML and get the image, then any of the
Ruby email libraries to send it to yourself. It's really a trivial problem,
but if you're having specific issues, I'm sure many of the people on this
list would be willing to help.

Alex



On Tue, May 26, 2009 at 2:44 PM, Jian Lin <blueskybreeze@gmail.com> wrote:

> Andrew Timberlake wrote:
> > On Tue, May 26, 2009 at 10:54 AM, SpringFlowers AutumnMoon
> > <blueskybreeze@gmail.com> wrote:
> >> using Ruby on my local Windows machine, can I easily write a script to
> >> download a comic strip every day and email it to myself?
> >>
> >> such as
> >> http://comics.c...
> >
> > Yes
>
> how is it done?
> --
> Posted via http://www.ruby-....
>
>

Andrew Timberlake

5/26/2009 7:11:00 PM

0

On Tue, May 26, 2009 at 8:57 PM, Alex <imphasing@gmail.com> wrote:
> I would use Hpricot to parse the HTML and get the image, then any of the
> Ruby email libraries to send it to yourself. It's really a trivial problem,
> but if you're having specific issues, I'm sure many of the people on this
> list would be willing to help.
>
> Alex
>

Even easier, find out how the images are named because they are often
named yyyymmdd.jpg or similar and then just try and pull the image for
the day in question.
404 - no image
200 - you've got it

Andrew Timberlake
http://ramblingso...

http://MyM... - The SIMPLE way to manage your savings

SpringFlowers AutumnMoon

5/26/2009 7:16:00 PM

0

Alex wrote:
> I would use Hpricot to parse the HTML and get the image, then any of the
> Ruby email libraries to send it to yourself. It's really a trivial
> problem,
> but if you're having specific issues, I'm sure many of the people on
> this
> list would be willing to help.

is it true that we just use the smtp.my-isp.com to send it? is there
any other way?

--
Posted via http://www.ruby-....

TPReal

5/26/2009 7:30:00 PM

0

Jian Lin wrote:
> using Ruby on my local Windows machine, can I easily write a script to
> download a comic strip every day and email it to myself?
>
> such as
> http://comics.c...

As for downloading a file:
http://al2o3-cr.blogspot.com/2008/08/downloading...
--
Posted via http://www.ruby-....

imphasing

5/26/2009 7:55:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

You can use any SMTP server to email the images. I would just use Net::SMTP
with whatever SMTP server you happen to be using. It's true that some ISPs
offer SMTP servers, but smtp.<your_isp>.com may not be the naming convention
that your ISP uses.

Remember, you're going to need to attach the image to the email as well, so
you'll need to create a multipart message, with the image data encoded in
base64. I'm sure there's a library that can handle that for you, although
I'm not very familiar with using ruby to manipulate email messages.



Alex


On Tue, May 26, 2009 at 3:15 PM, Jian Lin <blueskybreeze@gmail.com> wrote:

> Alex wrote:
> > I would use Hpricot to parse the HTML and get the image, then any of the
> > Ruby email libraries to send it to yourself. It's really a trivial
> > problem,
> > but if you're having specific issues, I'm sure many of the people on
> > this
> > list would be willing to help.
>
> is it true that we just use the smtp.my-isp.com to send it? is there
> any other way?
>
> --
> Posted via http://www.ruby-....
>
>