<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SciBuff.com &#187; APOD</title>
	<atom:link href="http://www.scibuff.com/tag/apod/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scibuff.com</link>
	<description>Science Blog</description>
	<lastBuildDate>Mon, 30 May 2011 00:47:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>APOD celebrates 15 years</title>
		<link>http://www.scibuff.com/2010/06/16/apod-celebrates-15-years/</link>
		<comments>http://www.scibuff.com/2010/06/16/apod-celebrates-15-years/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 09:23:34 +0000</pubDate>
		<dc:creator>scibuff</dc:creator>
				<category><![CDATA[Astro Photo]]></category>
		<category><![CDATA[Astronomy]]></category>
		<category><![CDATA[APOD]]></category>
		<category><![CDATA[Astrophotography]]></category>

		<guid isPermaLink="false">http://www.scibuff.com/?p=2202</guid>
		<description><![CDATA[On June 16, 1995 NASA and Michigan Technological University (MTU) launched a new website called The Astronomy Picture of the Day (APOD). APOD was presented at a meeting of the American Astronomical Society in 1996. It received a Scientific American Sci/Tech Web Award in 2001. As during each of the 15 years of selecting images, [...]]]></description>
			<content:encoded><![CDATA[<p>On June 16, 1995 NASA and Michigan Technological University (MTU) launched a new website called <a rel="nofollow" href="http://apod.nasa.gov/apod/" target="_blank">The Astronomy Picture of the Day (APOD)</a>. APOD was presented at a meeting of the American Astronomical Society in 1996. It received a Scientific American Sci/Tech Web Award in 2001.</p>
<div id="attachment_2203" class="wp-caption aligncenter" style="width: 532px"><a href="http://www.scibuff.com/blog/wp-content/uploads/2010/06/vermeer_stevenson.jpg" rel="lightbox[2202]"><img class="size-medium wp-image-2203" title="APOD is 15 years old" src="http://www.scibuff.com/blog/wp-content/uploads/2010/06/vermeer_stevenson-522x479.jpg" alt="APOD is 15 years old" width="522" height="479" /></a><p class="wp-caption-text">Whimsical Vermeer composite that ran on APOD&#39;s fifth anniversary now digitally re-pixelated using many of the over 5,000 APOD images that have appeared over APOD&#39;s tenure</p></div>
<blockquote><p>As during each of the 15 years of selecting images, writing text, and editing the APOD web pages, the occasionally industrious Robert Nemiroff (left) and frequently persistent Jerry Bonnell (right) are pictured above plotting to highlight yet another unsuspecting image of our cosmos. Although the above image may appear similar to the whimsical Vermeer composite that ran on <a rel="nofollow" href="http://apod.nasa.gov/apod/ap000616.html" target="_blank">APOD&#8217;s fifth anniversary</a>, a perceptive eye might catch that this year it has been digitally re-pixelated using many of the over 5,000 APOD images that have appeared over APOD&#8217;s tenure.</p></blockquote>
<p>It was a great honor to have a link to <a rel="nofollow" href="http://www.scibuff.com/2009/10/13/extremely-bright-fireball-seen-over-the-netherlands/" target="_blank">my blog post</a> appear in the <a href="http://apod.nasa.gov/apod/ap091015.html">APOD website on October 15, 2009</a>; you may remember:</p>
<div id="attachment_2204" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scibuff.com/blog/wp-content/uploads/2010/06/IMG_4235_mikaelyan_c800.jpg" rel="lightbox[2202]"><img class="size-medium wp-image-2204" title="Extremely bright fireball seen over the Netherlands" src="http://www.scibuff.com/blog/wp-content/uploads/2010/06/IMG_4235_mikaelyan_c800-640x480.jpg" alt="Extremely bright fireball seen over the Netherlands" width="640" height="480" /></a><p class="wp-caption-text">The brilliant fireball meteor captured in this snapshot was a startling visitor to Tuesday (October 13, 2009) evening&#39;s twilight skies over the city of Groningen - Credit: Robert Mikaelyan</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.scibuff.com/2010/06/16/apod-celebrates-15-years/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set APOD and AAPOD as your Desktop Pictures</title>
		<link>http://www.scibuff.com/2009/11/10/set-apod-and-aapod-as-your-desktop-pictures/</link>
		<comments>http://www.scibuff.com/2009/11/10/set-apod-and-aapod-as-your-desktop-pictures/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 19:36:36 +0000</pubDate>
		<dc:creator>scibuff</dc:creator>
				<category><![CDATA[Astronomy]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[AAPOD]]></category>
		<category><![CDATA[APOD]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[desktop picture]]></category>
		<category><![CDATA[dual screens]]></category>
		<category><![CDATA[perl script]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[two screens]]></category>

		<guid isPermaLink="false">http://www.scibuff.com/?p=1258</guid>
		<description><![CDATA[Download my APOD AAPOD Desktop application. Some time ago I wrote a little batch script that downloads the most recent Astronomy Picture Of Day (APOD) and sets it as your desktop wallpaper (on a Windows system). This time, I&#8217;ve improved on it a bit. First of all, it&#8217;s a for OSX (tested on OSX 10.5.8). [...]]]></description>
			<content:encoded><![CDATA[<p>Download my <a href="http://www.scibuff.com/blog/wp-content/uploads/2009/11/APOD_AAPOD_Desktop.zip">APOD AAPOD Desktop application</a>.</p>
<p>Some time ago I wrote a <a rel="nofollow" href="http://www.scibuff.com/2009/05/14/download-apod-and-set-it-as-the-wallpaper-batch-script/" target="_blank">little batch script</a> that downloads the most recent Astronomy Picture Of Day (APOD) and sets it as your desktop wallpaper (on a Windows system). This time, I&#8217;ve improved on it a bit. First of all, it&#8217;s a for OSX (tested on OSX 10.5.8). But the major improvement is that apart from an APOD image, it also downloads the Amateur Astronomy Picture Of Day (AAPOD) which it then sets as the Desktop Picture on my second screen.</p>
<p>Unlike for the Windows app, there is no need for any additional libraries (such as wget, grep, etc for win32) as a typical OSX installation has all necessary tools (curl and perl are required, but should be installed under the majority of installation settings). The main script, <code>wallpaper.pl</code>, that does all the hard work is written in Perl using its powerful text processing capabilities. The other core file, named <code>setdesktop.sh</code>, is just a simple <code>applescript</code> (executed via shell) that sets the Desktop Pictures for my two screens.</p>
<p>The <code>wallpaper.pl</code> is based on <a rel="nofollow" href="http://www.haroldbakker.com/personal/apod.php" target="_blank">Harold Bakker&#8217;s APOD script</a>. I have added some command line options and the bits to get the AAPOD image. By default, all images, both APOD and AAPOD, will be stored within the <code>images</code> directory (although this can be disabled via a command line option). When you unpack the <a href="http://www.scibuff.com/blog/wp-content/uploads/2009/11/APOD_AAPOD_Desktop.zip">application archive</a> there will be two items. One is the <code>apod_aapod.zip</code> containing the necessary files and the other is the <code>install.command</code>*.</p>
<p>The <code>install.command</code> is a simple shell script that sets everything up. It unpacks the contents of the <code>apod_aapod.zip</code> into the <code>/Applications/APOD_AAPOD/</code> directory (which it creates if the directory doesn&#8217;t exists). During the installation the <code>APOD_AAPOD.app</code> application is created (by compiling plain AppleScript using <code>osacompile</code>). Finally, the script will add the newly created application to your Login Items so that your desktop pictures are updated every time you log in.</p>
<p>In the default setting, the application is meant to work with two monitors system. The APOD image will be set as the desktop picture on the main screen and the AAPOD will be set as the desktop picture on the second screen. To modify this behavior is fairly easy:</p>
<div class="full-code">
<ol>
<li>Simply navigate to /Applications/APOD_AAPOD_Desktop/ directory and open the APOD_AAPOD.sh file.</li>
<li>Scroll all the way down pass the comments to the last line that reads:  perl wallpaper.pl -s -m 0 -n 2</li>
<li>Read more about the available flags and what they affect in the few lines above (in the end of the comments under &#8220;Usage&#8221;):
<ul>
<li>- to reverse the APOD and AAPOD screens, i.e have the AAPOD image be set as the desktop picture on your main monitor, just add the &#8216;-r&#8217; option, so that the line reads  perl wallpaper.pl -s -m 0 -n 2 -r</li>
<li>- to prevent the application from storing the downloaded images, simply remove the &#8216;-s&#8217; option</li>
<li>- If you have only a SINGLE monitor, you should change the value following the &#8216;-n&#8217; option to &#8217;1&#8242;.</li>
<li>- If would like to only download the APOD or only the AAPOS image, change the value after &#8216;-m&#8217; to 1 or 2, respectively.</li>
</ul>
</li>
</ol>
</div>
<p>To apply the changes, either wait until the next time you log, or run the &#8220;APOD_AAPOD&#8221; application.</p>
<p>* Note: The only reason is has the <code>.command</code> extension instead of the typical .sh is that so it can be executed by double-clicking on the file. If you prefer to run in via terminal, simply rename it to <code>install.sh</code> and run it via <code>sh install.sh</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scibuff.com/2009/11/10/set-apod-and-aapod-as-your-desktop-pictures/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Download APOD and set it as the wallpaper batch script</title>
		<link>http://www.scibuff.com/2009/05/14/download-apod-and-set-it-as-the-wallpaper-batch-script/</link>
		<comments>http://www.scibuff.com/2009/05/14/download-apod-and-set-it-as-the-wallpaper-batch-script/#comments</comments>
		<pubDate>Thu, 14 May 2009 14:25:15 +0000</pubDate>
		<dc:creator>scibuff</dc:creator>
				<category><![CDATA[Astronomy]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[APOD]]></category>
		<category><![CDATA[batch script]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[Space NASA]]></category>
		<category><![CDATA[wallpaper]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://www.scibuff.com/?p=284</guid>
		<description><![CDATA[Download my APOD Batch script. If you never heard of APOD you&#8217;ve missed a lot in the last 14 years. The website, supported by NASA and Michigan Technological University, has published an image from the universe with a commentary by a professional astronomer every day since June 16, 1995. I wanted an application which could [...]]]></description>
			<content:encoded><![CDATA[<p>Download my <a href="http://www.scibuff.com/blog/wp-content/uploads/apod.zip" target="_blank">APOD Batch script</a>.</p>
<p>If you never heard of <a title="Astronomy Picture of the Day" rel="nofollow" href="http://apod.nasa.gov/apod/" target="_blank">APOD</a> you&#8217;ve missed a lot in the last <acronym title="The first image appeared on June 16, 1995">14 years</acronym>. The website, supported by NASA and Michigan Technological University, has published an image from the universe with a commentary by a professional astronomer every day since June 16, 1995.</p>
<p>I wanted an application which could download the APOD on daily basis and set it as my desktop wallpaper. There are a few tools out there that come close to the desired functionality. Most of them are free, but they all require admin/root rights on the machine and some don&#8217;t even seem to be 100% spyware-free. Thus, I&#8217;ve decided to create a simple batch script which would accomplish this task for me.</p>
<blockquote><p><em>You may ask: Why bother creating an app if there already are similar ones out there? Well, usually I would say &#8220;don&#8217;t&#8221;. But, in this particular case, there actually wasn&#8217;t application which would work for me and/or had the functionality I was looking for. Besides, when it comes to programming, I like to do things myself. First, you always learn something new. Second, you can never be 100% sure that an executable does what it says it does. Sure, you can run tools such as TcpView and Process Explorer from <a rel="nofollow" href="http://technet.microsoft.com/en-us/sysinternals/default.aspx" target="_blank">SysInternals</a> and see for yourself if anything wacky is happening behind the scenes, but by then you really are getting in too deep. I wanted just to download an image from the net and set it as a wallpaper for cryin&#8217; out loud.</em></p></blockquote>
<p>I like to have all my apps and code properly structured, so as the first step I created a new directory for my app (it doesn&#8217;t matter where). Inside, I created two directories: &#8220;bin&#8221; and &#8220;images&#8221; (I&#8217;ll come back to those a bit later), and my &#8220;apod.bat&#8221; batch file. I opened the batch in my favorite text editor (notepad) and typed <code>@ECHO OFF</code> at the first line and <code>@ECHO ON</code> at the end. Right after the first line I inserted the following:</p>
<p><code>REM create the image directory if it doesn't exist<br />
IF NOT EXIST "images" mkdir "images"<br />
</code></p>
<p><code>REM</code> is a &#8220;command&#8221; equivalent to the comment tag <code>//</code> in most modern languages. The line after that checks whether the directory called &#8220;images&#8221; exists and if not it creates it.</p>
<p>Now that I&#8217;m happy with the initial setup, I can proceed to the &#8220;real stuff&#8221;. Immediately from the beginning I knew there were four basic steps to the script:</p>
<div id="batch-script-step1">1.) Read/download the most recent APOD HTML page</div>
<div id="batch-script-step2">2.) Search through the APOD HTML page and find the image source path</div>
<div id="batch-script-step3">3.) Download the APOD image</div>
<div id="batch-script-step4">4.) Set the APOD image as the desktop wallpaper.</div>
<p>In linux, <a href="#batch-script-step1">1.)</a>, <a href="#batch-script-step2">2.)</a> and <a href="#batch-script-step3">3.)</a> are very easy &#8211; all you need is to pass the right arguments to the <code>wget</code> and <code>grep</code> commands.</p>
<p><code>wget</code> is a simple yet powerful tool. I&#8217;m quite familiar with from the Linux environment so not even for a second did I look for a replacement on Windows, and went directly to <a title="GNU" rel="nofollow" href="http://www.gnu.org" target="_blank">GNU.org</a> which provides most of the GNU core utilities for shell and text manipulation as Windows binary. The <code>wget</code> win32 binaries can be downloaded from <a rel="nofollow" href="http://gnuwin32.sourceforge.net/packages/wget.htm" target="_blank">the wget page</a>. I will need the <code>Binaries</code> AND the <code>Dependencies</code>. After the packages were downloaded I unpacked them and place all binaries (*.exe and *.dll) into the &#8220;bin&#8221; folder created earlier.  Then I repeat the same steps for the <a rel="nofollow" href="http://gnuwin32.sourceforge.net/packages/grep.htm" target="_blank">grep</a> tool.</p>
<p><code>wget</code> will take care of steps <a href="#batch-script-step1">1.)</a> and <a href="#batch-script-step3">3.)</a> and I&#8217;ll use <code>grep</code> for <a href="#batch-script-step2">2.)</a>. Now I just need a tool for <a href="#batch-script-step4">4.)</a>. This one takes a bit of looking around. It can be achieved directly with registry modification but then again it could run into the admin/root rights problems. I tried a few alternatives and the <code>wallpaper changer</code> from <a title="Wallpaper Changer" rel="nofollow" href="http://www.sg20.com/wallpaperchanger/" target="_blank">sg20.com</a> had the best performance and 100% reliability. It does require <code>.NET 2.0</code> framework but any up-to-date windows system has it already installed (as either a built-in or thru windows update) these days &#8211; in case you don&#8217;t, it can be downloaded from the <a rel="nofollow" href="http://msdn.microsoft.com/netframework/downloads/updates/default.aspx" target="_blank">msdn website</a>. Once again, I downloaded the zip package and put the executable into the &#8220;bin&#8221; folder.</p>
<p>With all necessary tools ready in the &#8220;bin&#8221; folder I dove into the batch script itself. On the next line after the last edit,  I added the following</p>
<p><code>REM download todays APOD html<br />
bin\wget -N http://apod.nasa.gov/apod<br />
</code></p>
<p>The script above basically grabs the index.html from the APOD&#8217;s site (the <code>-N</code> flag ensures that the file is retrieved only if it is newer than the local copy). The index.html will contain the latest APOD image. The <code>grep</code> tool will search the html file using</p>
<p><code>REM get the big image url<br />
bin\grep -o "image.*big.*jpg" index.html &gt; images.txt<br />
</code></p>
<p>Most images on the APOD page are actually links to their largers sizes. The large images&#8217; file names are usually of the format of <code>&lt;ImageName&gt;_big.jpg</code>. The line of code above searches the html source for image(s) names following this pattern. In general, <code>grep</code> outputs an entire line when a match was found. To restrict the output to the search pattern only I used the <code>-o</code> flag.  Matches links are outputted into a temporary <code>image.txt</code> for later user. However, from time to time the big image name will not follow the above pattern (for example <a title="APOD May 15, 2009" rel="nofollow" href="http://apod.nasa.gov/apod/ap090514.html" target="_blank">here</a>). The few lines below will take care of that:</p>
<p><code>REM check if any images were found<br />
COPY&gt;nul images.txt nul |FIND "1 file(s) copied"</code></p>
<p>The code above investigates if any (big) images have been found in the APOD html by checking if the size of our <code>images.txt</code> is greater than 0.</p>
<p><code>REM if image(s) was/were found<br />
IF NOT errorlevel=1 GOTO found</code></p>
<p>If the size is greater than 0, the script continues to the <code>found</code> label (oh boy, I&#8217;d flank my CS class if my teacher saw me using labels &#8230;)</p>
<p><code>REM images.txt has 0 size<br />
IF errorlevel=1 GOTO not-found</code></p>
<p>If no images have been found, let&#8217;s just look for regular image names in the html files, i.e. not just the big ones.</p>
<p><code>REM get any type of image from the apod page<br />
:not-found<br />
bin\grep -o "image.*jpg" index.html &gt; images.txt<br />
goto found</code></p>
<p>After these few lines of code, we will have the APOD image filename(s) safely stored in the images.txt and we only need to download them.</p>
<p>I could just used the <code>-i</code> flag with <code>wget</code> to set <code>images.txt</code> as the input file. <code>wget</code> would simply run on every line of the file. Nevertheless, the line of code with <code>grep</code> looked only for image names, not full paths, so we need to add the path to the image directory. I used a simple <code>FOR</code> loop like so:</p>
<p><code>:found<br />
REM download image(s)<br />
FOR /F "tokens=*" %%G IN (images.txt) DO ( bin\wget -N "http://apod.nasa.gov/apod/%%G" )</code></p>
<p>Finally, the APOD image is downloaded, so I move it to the &#8220;images&#8221; folder as set it as the wallpaper</p>
<p><code>REM move image(s) to the image folder<br />
FOR /F "tokens=*" %%G IN ('DIR /B *.jpg') DO (<br />
MOVE "%%G" "images\%%G"<br />
bin\WallpaperChanger.exe %~dp0images\%%G 1<br />
)</code></p>
<p><code>DIR /B *.jpg</code> lists all jpg&#8217;s in the current directory using the &#8220;bare&#8221; format (no heading information or summary).</p>
<p>The <code>MOVE "%%G" "images\%%G"</code> takes every match jpg&#8217;s and moves it into the &#8220;images&#8221; folder.</p>
<p>Finally <code>bin\WallpaperChanger.exe</code> sets the image as the desktop wallpaper. One important detail here is to use full path to the image. I can get the directory of the batch script using <code>%~dp0</code> and adding <code>images\%%G</code> after that will do. I also specify <code>1</code> as the second parameter which stands for &#8220;Tiled&#8221; (1 is for Centered and 2 for Stretched) that sets the wallpaper settings.</p>
<p>As the very last step, I delete the temporary files the script used</p>
<p><code>DEL images.txt<br />
DEL index.html</code></p>
<p>and the batch script is done. Here it is in its full:</p>
<div class="full-code">
<p><code>@ECHO OFF</code></p>
<p><code>REM create the image directory if it doesn't exist<br />
IF NOT EXIST "images" mkdir "images"</code></p>
<p><code>REM download todays APOD html<br />
bin\wget -N http://apod.nasa.gov/apod</code></p>
<p><code>REM get the big image url<br />
bin\grep -o "image.*big.*jpg" index.html &gt; images.txt</code></p>
<p><code>REM check if any images were found<br />
COPY&gt;nul images.txt nul |FIND "1 file(s) copied"</code></p>
<p><code>REM download found images<br />
IF not errorlevel=1 GOTO found</code></p>
<p><code>REM images.txt has 0 size<br />
IF errorlevel=1 GOTO not-found</code></p>
<p><code>REM get any type of image from the apod page<br />
:not-found<br />
bin\grep -o "image.*jpg" index.html &gt; images.txt<br />
goto found</code></p>
<p><code>:found</code></p>
<p><code>REM download image(s)<br />
FOR /F "tokens=*" %%G IN (images.txt) DO (<br />
bin\wget -N "http://apod.nasa.gov/apod/%%G"<br />
REM skip all other images<br />
GOTO downloaded<br />
)<br />
:downloaded</code></p>
<p><code>REM move image(s) to the image folder<br />
FOR /F "tokens=*" %%G IN ('DIR /B *.jpg') DO (<br />
MOVE "%%G" "images\%%G"<br />
bin\WallpaperChanger.exe %~dp0images\%%G 1<br />
REM skip all other images<br />
goto end<br />
)<br />
goto end</code></p>
<p><code>:end<br />
DEL images.txt<br />
DEL index.html</code></p>
<p><code>@ECHO ON</code></div>
<p>You can download the APOD batch (including the batch script,<code> wget</code>, <code>grep</code> and the <code>WallpaperChanger</code> tools) <a href="http://www.scibuff.com/blog/wp-content/uploads/apod.zip" target="_blank">here</a>.</p>
<p>Below is a list of some APOD applications for different platforms:</p>
<p>Windows</p>
<p>- <a title="Pic APOD" rel="nofollow" href="http://www.troz.net/Pic-a-POD/Pic-a-POD.zip" target="_blank">Pic APOD</a></p>
<p>OS X</p>
<p>- <a title="Automatic APOD Desktop" rel="nofollow" href="http://orbitingfrog.com/blog/2008/09/01/get-an-automatic-apod-desktop/" target="_blank">Automatic APOD Desktop</a></p>
<p>Linux</p>
<p>- <a title="APOD fetch shell script" rel="nofollow" href="http://staff.science.uva.nl/~ygrange/scripts/fetchapod.sh" target="_blank">APOD fetch shell script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scibuff.com/2009/05/14/download-apod-and-set-it-as-the-wallpaper-batch-script/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

