download a comic strip and email to myself with Ruby?

Discussion in 'Ruby' started by SpringFlowers AutumnMoon, May 26, 2009.

  1. SpringFlowers AutumnMoon, May 26, 2009
    #1
    1. Advertising

  2. Andrew Timberlake, May 26, 2009
    #2
    1. Advertising

  3. SpringFlowers AutumnMoon

    Jian Lin Guest

    Andrew Timberlake wrote:
    > On Tue, May 26, 2009 at 10:54 AM, SpringFlowers AutumnMoon
    > <> 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.com/peanuts

    >
    > Yes


    how is it done?
    --
    Posted via http://www.ruby-forum.com/.
    Jian Lin, May 26, 2009
    #3
  4. SpringFlowers AutumnMoon

    Alex Guest

    [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 <> wrote:

    > Andrew Timberlake wrote:
    > > On Tue, May 26, 2009 at 10:54 AM, SpringFlowers AutumnMoon
    > > <> 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.com/peanuts

    > >
    > > Yes

    >
    > how is it done?
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >
    Alex, May 26, 2009
    #4
  5. On Tue, May 26, 2009 at 8:57 PM, 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.
    >
    > 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://ramblingsonrails.com

    http://MyMvelope.com - The SIMPLE way to manage your savings
    Andrew Timberlake, May 26, 2009
    #5
  6. SpringFlowers AutumnMoon

    Jian Lin Guest

    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-forum.com/.
    Jian Lin, May 26, 2009
    #6
  7. SpringFlowers AutumnMoon

    Thomas B. Guest

    Thomas B., May 26, 2009
    #7
  8. SpringFlowers AutumnMoon

    Alex Guest

    [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 <> 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-forum.com/.
    >
    >
    Alex, May 26, 2009
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Default User

    Today's Foxtrot comic strip

    Default User, Oct 3, 2003, in forum: C Programming
    Replies:
    1
    Views:
    665
    Ben Pfaff
    Oct 3, 2003
  2. Samuel van Laere

    IE6 Comic Strip

    Samuel van Laere, Mar 20, 2010, in forum: HTML
    Replies:
    2
    Views:
    709
    Jonathan N. Little
    Mar 21, 2010
  3. Aquila
    Replies:
    35
    Views:
    437
    Mathieu Bouchard
    Mar 31, 2005
  4. Weber
    Replies:
    1
    Views:
    92
    Jeremy Henty
    Jan 24, 2007
  5. yelipolok
    Replies:
    4
    Views:
    239
    John W. Krahn
    Jan 27, 2010
Loading...

Share This Page