/    Sign up×
Community /Pin to ProfileBookmark

Reading image source out of other Page

Hello,

I’m new here and new to JavaScript. There’s a thing I would need for my website: I want to include an image from an other site. But it’s url is changing every day because the image changes every day.
(That’s the site: [url]http://apod.nasa.gov/apod/[/url])

How can I find out the image url with javascript and show it on my website?

Thanks in advance!

Okuro

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@SockwaveJan 16.2011 — You can do this, but maybe you shouldn't? That page has a disclaimer about image permissions:

http://apod.nasa.gov/apod/lib/about_apod.html#srapply

which specifically doesn't allow unlimited reproduction. I admit that it's very unlikely that you will have any legal trouble with this, but it's not considered good form to run other people's content on your site without permission.
Copy linkTweet thisAlerts:
@OkuroauthorJan 22.2011 — Hello,

I see, thanks for the tip!

Anyway, how would it work if it was legal? (on other websites...)

Thanks!
Copy linkTweet thisAlerts:
@OkuroauthorJan 26.2011 — any ideas?
Copy linkTweet thisAlerts:
@KorJan 27.2011 — 
Anyway, how would it work if it was legal?[/QUOTE]

But it is not. Period.
Copy linkTweet thisAlerts:
@OkuroauthorJan 27.2011 — But it is not. Period.[/QUOTE]

Indeed, I referred to other NASA-Websites where the images aren't protected with copyright and everybody is allowed to use them as often and where ever they want if they quote NASA.
Copy linkTweet thisAlerts:
@KorJan 27.2011 — Indeed, I referred to other NASA-Websites where the images aren't protected with copyright and everybody is allowed to use them as often and where ever they want if they quote NASA.[/QUOTE]
Maybe. But inserting in your page an absolute url to a picture which belongs to another domain is not recommended. Don't confound the rights to use a picture with the rights to insert a link to that picture.

You may use a combination AJAX+server-side proxy code. If your server allows PHP, see:

http://www.troywolf.com/articles/

You should rather use a server-side code to load that picture into your domain and use it from your domain. Of course, mentioning who is the owner, and the rest of courtesy, etc.
Copy linkTweet thisAlerts:
@rnd_meJan 27.2011 — NASA cannot copyright their images or text: they are a US government agency and as such are banned from holding copyrights by our constitution.

that's why i embed the APOD on the front page of a site i built: http://www.astro.uiuc.edu/


we haven't gotten any cease-and-desist letters yet; not holding my breath.

i used a small asp script to grab the html from the APOD site and sniff out the image url.
×

Success!

Help @Okuro spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...