• 0

Retrieving an image from some sites


Question

Hey guys,

I'm currently in the process of creating a website.

Here's what I want to do.. I want a script to automatically update a link to be the latest comic.

Basically... I'll have a link that says "Dilbert", and when clicked on, it should take you to the latest dilbert comic, directly to the gif. The URL for any day's comic would be:

http://www.dilbert.com/comics/dilbert/archive/images/dilbert[year][month][seeminglyRandomNumbers][date].gif

Today's comic is at http://www.dilbert.com/comics/dilbert/arch...40112199317.gif

Is there any way I can do this with a PHP script? I have very little knowledge in PHP, so uber-noob terms would be appreciated.

I'm planning on hosting this site on my own machine, so I wouldn't mind making a C++ application for that instead: an application scheduled to run at 2AM that would retreive the URL of the latest comic and update it inside an HTML document on my hard drive.. Would that be a better alternative?

Edited by HellBender
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Q: Can I put Dilbert on my Web site or corporate intranet?

A: Dilbert may be licensed for electronic reproduction from United Media for certain Internet sites and corporate intranets. For rates and availability please contact:

U.S. and Canada Online Sales & Syndication

ATTN: Maura Peters

United Media

200 Madison Avenue

New York, NY 10016

ph: 212-293-8603

800-221-4816 ext. 603

fax: 212-293-8600

e-mail: mpeters@unitedmedia.com

  International Online Sales & Syndication

ATTN: Anna Soler

United Media

200 Madison Avenue

New York, NY 10016

ph: 212-293-8723

fax: 212-293-8720

e-mail: asoler@unitedmedia.com

For permission to reprint Dilbert in print publications, please see the comics.com FAQ.

Q: I want to link to your site using a graphic of Dilbert and/or Dogbert. Is this OK? How about putting a selection of comics with the same filename so I can include a continuously updating comic on my Web page? I'm thinking of an automated HTML writer that would generate a link to the Dilbert comics.

A: Please do not use any material from Dilbert.com on your web site, other than the official link icons. Taking material from our web site and displaying it on your web page without our permission violates United Media's copyrights. Please do not use any Dilbert link icons other than the ones on our link icons page. You can download an official icon and use it as a link to our site and provide your readers with access to the comics.

Yeah, theres definitely no free legal way to do it... you could always contact them to see how much it would cost

... but its probably a lot easier to just have a link to dilbert.com.

Even though you could make something to read the page with the image on it, you would probably be noticed by the dilbert people before you can say Catbert. They could just check their referrer logs for large amounts of referrings from sites other that dilbert.com. It would just be a lot cheaper, easier and legally safer to link to dilbert.com

Link to comment
Share on other sites

  • 0

well i havent got the time to do it right now, but ill help anyone who wants to do it (you'll need to know PHP quite well)

You need to open this page: (the [] brackets indicate parts of the date)

http://www.dilbert.com/comics/dilbert/archive/dilbert-[2004][01][18].html

Then use eregi to extract the links in this string:

I could d<img SRC="/images/clear_dot.gif" WIDTH="5" HEIGHT="5" ALT="" BORDER="0"><br><a href="/comics/dilbert/archive/images/(.*).jpg"><img SRC="/comics/dilbert/archive/images/dilbert(.*).jpg" BORDER=0 ALT="Today's Dilbert Comic"></a><br><br></td>

then you can use \$1 and \$2 to have the link and the image for today ;)

The only drawback for this method is that it will use a lot of bandwidth for what you actually want to achive

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.