Apple ][ Graphics as your Screensaver or Second Screen

apple2-xscreensaver-weather-demo

Hipsters rejoice, you can actually make those high-tech IPS panels look like crap. Really nostalgic crap. [Kaveen Rodrigo] wrote in to show how he displays weather data as his Apple ][ emulated screensaver.

2014-07-08-234300_1366x768_scrotHe’s building on the Apple2 package that is part of the xscreensaver available on Linux systems. The program has an option flag that allows you to run another program inside of it. This can be just about anything including using it as your terminal emulator. [Adrian] recently sent us the screenshot shown here for our retro edition. He is running bash and loaded up freenet just to enjoy what it used to be like in the good old days.

In this case, [Kaveen] is using Python to pull in, parse, and print out a Yahoo weather json packet. Since it’s just a program that is called when the screensaver is launched, you can use it as such or just launch it manually and fill your second monitor whenever not in use.

We gave it a whirl, altering his code to take a tuple of zip codes. Every hour it will pull down the data and redraw the screen. But we’ve put enough in there that you’ll be able to replace it with your own data in a matter of minutes. If you do, post a screenshot and what you’re using it for in the comments.

Here’s our example code:

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
#  a2.py
#  Based on the work of Kaveen Rodrigo which can be found here:
#  http://geeknirvana.org/?p=4
#  The original carried the following license:
#  
#  Copyright 2014 Kaveen Rodrigo <kaveenr@KNET>
#  
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#  MA 02110-1301, USA.
#  
#  
 
import urllib2,json,time,os

locationCodes = (53716,91105,17201)
 
def getIt(postalCode):
        try:
                html = urllib2.urlopen("http://query.yahooapis.com/v1/public/yql?q=select%20item%20from%20weather.forecast%20where%20location%3D%22"+str(postalCode)+"%22&format=json").read()
                return json.loads(html)
        except:
                print("Are you on the innernet?")
                exit()

def main():
        while True:
		for code in locationCodes:
	                js = getIt(code)
	                print(js["query"]["results"]["channel"]["item"]["title"])
        	        print(js["query"]["results"]["channel"]["item"]["condition"]["text"]+" Temp "+js["query"]["results"]["channel"]["item"]["condition"]["temp"]+" F")
			print
			print
                time.sleep(3600)
		os.system('clear')
		print "                apple ]["
                print
        return 0
if __name__ == '__main__':
        main()

Comments

  1. Mateus says:

    Argh… I really need to take some time to learn python =/

  2. Osgeld says:

    I just use an apple II lol

  3. cyberteque says:

    LOL

    In countries where PAL is the colour standard for video, we like NTSC is usually referred to as “Never Twice Same Colour”!

    We suffered with our Apple video until an Australian company, McClaggin Wright, produced, amongst other things, a truly brilliant PAL video card.

  4. arko says:

    I noticed it said 70C in the demo screenshot. As I’m sure you’d be roasted if it was going to be that hot, I figured you may want to replace “%22&format=json” with “%22and%20u%3D%22c%22&format=json”. That way you query the temperature in C and not in F. Otherwise you could just change the “C” to “F” in the print statement.

    Fun screensaver :)

  5. Mr Name Required says:

    Screenshot shows temps of 70 C, 63 C and 71 C? I realise it’s summer in the northern hemishpere but I didn’t think it got that hot! :)

  6. EdgarVice says:

    Mhhh, ok? so what’s new in this article? Did the exact thing 6 Years ago…

    • Ben in Seattle says:

      Yes, but you didn’t share it with us on Hack-a-Day. Besides, if you really want to get down to “who did it first”, I did the exact same thing, but using an actual Apple //e back in the 1980’s. So there.

    • MTE says:

      My thoughts exactly. What is the next post going to be? “Man attaches two tubes together with ducttape.”

  7. jgiop says:

    >This may not work out of the box in Ubuntu Read this to figure out.
    For a simple screensaver one has to mess with some system internals. This is why desktop linux will always remain at that magical 1%.

    Fun fact: about 1% of US children are autistic.

  8. Emilio Vasquez says:

    There is also ‘m6502′ in the xscreensaver collection. You know, the reimplementation of http://www.6502asm.com/ for your screen saver… :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,312 other followers