Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Website Design/Showcase (http://www.chiefdelphi.com/forums/forumdisplay.php?f=64)
-   -   Getting an image from a website (http://www.chiefdelphi.com/forums/showthread.php?t=28947)

Raven_Writer 05-06-2004 09:23

Getting an image from a website
 
Every day, NASA's Astronomy site puts up a new image. What I'm wondering is how could I check to see if there is a new image, and if so display it (download it, or something). I don't even know if this is possible.

If you can help at all, please let me know.

Astronouth7303 05-06-2004 09:48

Re: Getting an image from a website
 
In what? In VB, you have the Inet control. You download the homepage and find "<IMG SRC=""" (2 double quotes is a double quote w/o ending the string). Then you take what's between that and """". That is your path. Again using the Inet control, download the image using the path extracted, and save it to a location. Then you can do whatever with it.

Raven_Writer 05-06-2004 11:01

Re: Getting an image from a website
 
Quote:

Originally Posted by Astronouth7303
In what? In VB, you have the Inet control. You download the homepage and find "<IMG SRC=""" (2 double quotes is a double quote w/o ending the string). Then you take what's between that and """". That is your path. Again using the Inet control, download the image using the path extracted, and save it to a location. Then you can do whatever with it.

Sorry about that, I forgot to mention to display it on another website. Like, would it be possible to do this through PHP, or even ASP? Thanks though very much.

Astronouth7303 05-06-2004 11:20

Re: Getting an image from a website
 
Quote:

Originally Posted by Raven_Writer
Sorry about that, I forgot to mention to display it on another website. Like, would it be possible to do this through PHP, or even ASP? Thanks though very much.

You mean other than having windows run a VBscript? ;) no idea.

Tom Bottiglieri 05-06-2004 11:22

Re: Getting an image from a website
 
is it just me.. or does the pic for 6/5 ( http://antwrp.gsfc.nasa.gov/apod/ima...ollo17_big.jpg ) look fake?

Joe Ross 05-06-2004 11:24

Re: Getting an image from a website
 
I would use a cron script that would download the page with wget, delete the html file, then rename the .jpg to the file that you are displaying on your webpage.

Raven_Writer 05-06-2004 11:24

Re: Getting an image from a website
 
Quote:

Originally Posted by ToMMan b182
is it just me.. or does the pic for 6/5 ( http://antwrp.gsfc.nasa.gov/apod/ima...ollo17_big.jpg ) look fake?

Heh. Yea, I kinda thought the same.

A lot of the pictures on there are sweet none-the-less, even if they are fake, though.

Joe: Thanks, I'll try that and see what happens.

Astronouth7303 05-06-2004 11:37

Re: Getting an image from a website
 
Quote:

Originally Posted by ToMMan b182
is it just me.. or does the pic for 6/5 ( http://antwrp.gsfc.nasa.gov/apod/ima...ollo17_big.jpg ) look fake?

really? how so?

Max Lobovsky 05-06-2004 17:00

Re: Getting an image from a website
 
Quote:

Originally Posted by Astronouth7303
really? how so?

I think they were watching that stupid FOX special about how the Apollo landings were fake. Please see here if you were convinced by that propaganda: http://www.badastronomy.com/bad/tv/i...ard/moon01.htm.

Astronouth7303 05-06-2004 20:19

Re: Getting an image from a website
 
Quote:

Originally Posted by maxlobovsky
I think they were watching that stupid FOX special about how the Apollo landings were fake. Please see here if you were convinced by that propaganda: http://www.badastronomy.com/bad/tv/i...ard/moon01.htm.

I heard about that. My question to the conspirisy theorists: Where'd the cash go?

ahecht 08-06-2004 03:23

Re: Getting an image from a website
 
I currently have my home computer set up to download the Astronomy Picture of the Day every day, resize it, and put it in my background rotation automatically.

To do it, I used a combination of DailyStrips and ImageMagick.

Full instructions are on my web site at http://zansstuff.com/rotatedesktop.html#apod

If you just want to display it on another web site, DailyStrips is a Perl script, and you could set it up to run as a chron job (and write a little script to rename each day's file to a constant name or modify the Perl to always output the same name), or you could modify it so that it displayed the fetched image as an output when called by a browser.

greencactus3 08-06-2004 13:10

Re: Getting an image from a website
 
Quote:

Originally Posted by Astronouth7303
I heard about that. My question to the conspirisy theorists: Where'd the cash go?

not that i dont believe that nasa landed on the moon, but its the government. where do you think our money goes ;)
and if you got a wad of cash and was told you can either use it all up, or you can use half of it to let everyone believe you used it all up, and you keep the rest,which would you do? :D

Ryan F. 08-06-2004 13:43

Re: Getting an image from a website
 
Quote:

Originally Posted by Astronouth7303
I heard about that. My question to the conspirisy theorists: Where'd the cash go?

Where did the rocket go?

--Also....elvis is surely still alive!

seanwitte 08-06-2004 14:07

Re: Getting an image from a website
 
The .NET Framework includes a class named WebRequest that will do what you're asking. You give it a URL and it returns the results as a stream. Then you just read the stream and write it to disk. Check MSDN, there is probably some sample code available.

Greg Needel 09-06-2004 09:02

Re: Getting an image from a website
 
Quote:

Originally Posted by greencactus3
but its the government. where do you think our money goes


"you don't think they spend 200 dollars on a hammer, 500 bucks on a toliot seat do you?"

Greg 09-06-2004 10:55

Re: Getting an image from a website
 
In PHP, you can also use socket connections (similar to the Inet control in VB). Your hosting service has to allow it though :) By the way, fopen will open remote files too.

Raven_Writer 09-06-2004 11:21

Re: Getting an image from a website
 
Quote:

Originally Posted by ahecht
I currently have my home computer set up to download the Astronomy Picture of the Day every day, resize it, and put it in my background rotation automatically.

To do it, I used a combination of DailyStrips and ImageMagick.

Full instructions are on my web site at http://zansstuff.com/rotatedesktop.html#apod

Thank you :)

I've checked that out, and as soon as finals are over with, I will try that and see what happens.

Greg: I started thinking about that, but the problem is that NASA creates a new directory (as far as I know) each day for the pictures.

Astronouth7303 09-06-2004 11:39

Re: Getting an image from a website
 
Quote:

Originally Posted by Raven_Writer
Greg: I started thinking about that, but the problem is that NASA creates a new directory (as far as I know) each day for the pictures.

At least a different file for each picture. You pretty much have to extract the URL from the page.


All times are GMT -5. The time now is 00:26.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi