Jump to content

Earth view from the IIS


james3mg
 Share

Recommended Posts

I made this because...I thought it would be fun, and I found a website that makes this easy (thanks fourmilab.ch)

You can run this just as a script, or to actually set it to your screensaver, compile to a .exe, rename the *.exe to *.scr and copy the file into @systemdir. Now pick it from windows' normal screensaver dialog.

Next I'm trying to figure out how to use google maps to get an aerial view (not live). I can find the current IIS lat/long online and I can plug that into google maps' URL to get right to the view I want, but of course I get all the other website stuff too...links, search, businesses, etc. I'm trying to figure out how to just pull the map part out (leaving the watermarked copyrights intact :lmao: ) We'll see...

Edit: See Post #9 for the Google Maps version of this screensaver.

For now however, enjoy!

#include <GUIConstants.au3>
#include <Date.au3>
#NoTrayIcon

If $CmdLine[0] <> 0 Then
    If StringLeft($CmdLine[1],2)="/c" Then
        MsgBox(16,"Error","This screen saver has no options you can configure.")
        Exit
    ElseIf $CmdLine[1]="/p" Then
        Exit;I can't get the child stuff to work right...below code works unless you move the "Screen Saver Config" window...then it gets left behind.
        GUICreate("Earth from the ISS",152,112,-3,-24,$WS_POPUP, $WS_EX_MDICHILD + $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST,$CmdLine[2])
        GUISetBkColor(0x000000)
        InetGet("http://www.fourmilab.ch/cgi-bin/Earth?img=nasa.evif&imgsize=112&dynimg=y&lat=&lon=&alt=&opt=-b&bird=ISS+%28ZARYA%29&tle=&date=0&utc=&jd=",@TempDir & "\IISss.jpg",1)
        $ThePic=GUICtrlCreatePic(@TempDir & "\IISss.jpg",0,0,112,112)
        GUISetState()
        Do
            Sleep(10)
        Until NOT WinExists("Screen Saver","Iisss")
        Exit
    EndIf
EndIf

Global Const $SM_VIRTUALWIDTH = 78
Global Const $SM_VIRTUALHEIGHT = 79
$VirtualDesktopWidth = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALWIDTH)
$VirtualDesktopWidth = $VirtualDesktopWidth[0]
$VirtualDesktopHeight = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALHEIGHT)
$VirtualDesktopHeight = $VirtualDesktopHeight[0]

Global $ImageSize=1024
If $ImageSize>@DesktopHeight-25 Then $ImageSize=@DesktopHeight-26
Global Const $ImageSpeed=1
Global $MouseStartPos=MouseGetPos()

AdlibEnable("AdlibExiter",1000)

GUICreate("Earth from the ISS",$VirtualDesktopWidth,$VirtualDesktopHeight,0,0,$WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$TheText=GUICtrlCreateLabel("Please wait...loading",@DesktopWidth/2-150,@DesktopHeight/2,300,-1,$SS_CENTER,$WS_EX_TOPMOST)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)
GUISetState()
GUISetCursor(16,1)
InetGet("http://www.fourmilab.ch/cgi-bin/Earth?img=nasa.evif&imgsize="&$ImageSize&"&dynimg=y&lat=&lon=&alt=&opt=-b&bird=ISS+%28ZARYA%29&tle=&date=0&utc=&jd=",@TempDir & "\IISss.jpg",1)
$ImagePosX=Random(0,$VirtualDesktopWidth-$ImageSize,1)
$ImagePosY=Random(0,$VirtualDesktopHeight-$ImageSize,1)
$ImageChangeX=$ImageSpeed
$ImageChangeY=$ImageSpeed
$ThePic=GUICtrlCreatePic(@TempDir & "\IISss.jpg",$ImagePosX,$ImagePosY,$ImageSize,$ImageSize)
GUICtrlSetPos($TheText,@DesktopWidth/2-150,0)
While 1
    Global $ReloadTimer=TimerInit()
    InetGet("http://www.fourmilab.ch/cgi-bin/Earth?img=nasa.evif&imgsize="&$ImageSize&"&dynimg=y&lat=&lon=&alt=&opt=-b&bird=ISS+%28ZARYA%29&tle=&date=0&utc=&jd=",@TempDir & "\IISss.jpg",1,1)
    Do
        Sleep(10)
    Until @InetGetActive=0 AND TimerDiff($ReloadTimer)>30000;download is complete and it's been 30 seconds since last request, so the server doesn't block you.
    GUICtrlSetImage($ThePic,@TempDir & "\IISss.jpg")
    $ImagePosX+=$ImageChangeX
    $ImagePosY+=$ImageChangeY
    If ($ImagePosX+$ImageSize>$VirtualDesktopWidth AND $ImageChangeX>0) OR ($ImagePosX<0 AND $ImageChangeX<0) Then $ImageChangeX=$ImageChangeX*-1
    If ($ImagePosY+$ImageSize>$VirtualDesktopHeight AND $ImageChangeY>0) OR ($ImagePosY<0 AND $ImageChangeY<0) Then $ImageChangeY=$ImageChangeY*-1
    GUICtrlSetPos($ThePic,$ImagePosX,$ImagePosY)
WEnd

Func AdlibExiter()
    If (ABS(MouseGetPos(0)-$MouseStartPos[0])>5 OR ABS(MouseGetPos(1)-$MouseStartPos[1])>5) AND ($CmdLine[0]=0 OR $CmdLine[1] = "/s") Then
        Exit
    Else
        $MouseStartPos=MouseGetPos()
    EndIf
    GUICtrlSetData($TheText,"Earth view from the ISS at "&_Now())
EndFunc
Edited by james3mg
"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

Quite Interesting screensaver. I like it :lmao:

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Every 30 seconds

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Does the image update? I didn't see much updating there..

Thanks, Razer, that's right -30 seconds.

I had it updating as often as possible at first, but the site blocked me for requesting too many images in a 10-minute time period. The interesting thing, it wasn't blocking my IP, it was blocking the specific requested image (size, satellite view, etc). So I kicked it down to 30 seconds (admittedly not very often) because if many people are using this screensaver and happen to have the same screen resolution, they might end up blocking each other. Maybe I should have randomized the size of the picture requested +/- about 20 pixels...

Glad you all like it! :geek:

As a follow-up, to my original post, I got a Google Maps API key which licences me unlimited image requests as long as I use Lat/Long. So *hopefully* in a few days there will be a better version of this here...it won't be the round globe, but a nice zoomed-in aerial view of what the IIS crew would see if they were using a telescope to look toward earth :ph34r: . I'm still trying to figure out how to interface with the javascript in an embedded COM $oIE control. :lmao:

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

Sounds really good!

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

OK, I got the Google Maps version running. It's not perfect yet, but I'll keep working on it.

Problems:

-Loading is bad. Just ignore the first 10 seconds. It's hard to fix this.

-It's dependant on an enthusiast's webpage, which may change without warning. I can't find an official page listing current positions, and I can't for the life of me digest the pages of formulas for calculating the current position myself.

-Screen saver functionality isn't 100%...keyboard won't terminate it (only mouse) and there's no preview.

-Since it's dependant on external webpages, I get errors sometimes because the page isn't totally loaded. Haven't found a workaround, _IELoadWait() doesn't seem to fix it either. But I check for the errors, so the end user doesn't even know they happened.

-Two files are required, the script/executable and the .html file. I tried writing the HTML into a blank $oIE COM (ActiveX?) object, but it didn't work right. So put both files in the same place, and it will FileInstall it into the @TempDir

-The mouse won't go away. I can't seem to override the ActiveX's mouse settings. Maybe I should just move it to 0,@DesktopHeight...

I wanted this originally to be zoomed in much more, but there were two problems with this.

1) the IIS moves FAST. (5 miles/second) It'd never load it fast enough, and you'd have no continuity from one position to the next. It might as well be a slideshow of random places.

2) I couldn't figure out a good enough way to check if it was over the ocean or somewhere the imagery wasn't that good and zoom out over these places. So I ended up with lots of screens of "Sorry, we don't have imagery at that level, try zooming out".

So this is the best I have so far. I'll keep developing on it. :lmao: In the meantime, I think this looks pretty good...enough for most people :ph34r:

Here is the .au3 code to look at, but don't forget to download the attached .html file and put it in the same directory for the FileInstall() command.

#include <GUIConstants.au3>
#include <IE.au3>
#include <File.au3>
#NoTrayIcon

FileInstall("GoogleMapsIIS.html",@TempDir&"\GoogleMapsIIS.html",1)

If $CmdLine[0] <> 0 Then
    If StringLeft($CmdLine[1],2)="/c" Then
        MsgBox(16,"Error","This screen saver has no options you can configure.")
        Exit
    ElseIf $CmdLine[1]="/p" Then
        Exit
    EndIf
EndIf

Global Const $SM_VIRTUALWIDTH = 78
Global Const $SM_VIRTUALHEIGHT = 79
$VirtualDesktopWidth = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALWIDTH)
$VirtualDesktopWidth = $VirtualDesktopWidth[0]
$VirtualDesktopHeight = DLLCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALHEIGHT)
$VirtualDesktopHeight = $VirtualDesktopHeight[0]

Global $oIE = ObjCreate("Shell.Explorer.2")
Global $oIEData = ObjCreate("Shell.Explorer.2")
Global $IssData, $IssDataForm

Global $MouseStartPos=MouseGetPos()
AdlibEnable("AdlibExiter",1000)

GUICreate("IIS in Google Maps",$VirtualDesktopWidth+8,$VirtualDesktopHeight+8,0,0,$WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
GUISetBkColor(0x000000)

GUICtrlCreateObj($oIE,-2,-2,$VirtualDesktopWidth+6,$VirtualDesktopHeight+6)
GUICtrlCreateObj($oIEData,-1,0,1,1)

_FileWriteToLine(@TempDir&"\GoogleMapsIIS.html",24,'<div id="map" style="width: '&$VirtualDesktopWidth+2&'px; height: '&$VirtualDesktopHeight+2&'px"></div>',1)

GUISetState()

$oIE.navigate(@TempDir&"\GoogleMapsIIS.html")
$oIEData.navigate("http://www.amsat.org/amsat-new/tools/predict/satloc.php?lang=en&satellite=ISS")

Sleep(10000)
Global $ReloadTimer=TimerInit()
While 1
    If TimerDiff($ReloadTimer) > 7200000 Then
        $oIEData.navigate("http://www.amsat.org/amsat-new/tools/predict/satloc.php?lang=en&satellite=ISS")
        $ReloadTimer=TimerInit()
        Sleep(10000)
    EndIf
    $IssDataForm=_IEFormGetObjByName($oIEData,"oF")
    $IssData=_IEBodyReadText($IssDataForm)
    $IssData=StringSplit($IssData,@CR)
    For $i=1 To $IssData[0]
        If StringInStr($IssData[$i],"Current Location:") <> 0 Then
            $IssData=$IssData[$i]
            ExitLoop
        EndIf
    Next
    $IssData=StringRight($IssData,StringLen($IssData)-19)
    If StringLen($IssData)>4 Then
        $IssData=StringSplit($IssData," ")
        If StringRight($IssData[1],1)="W" Then
            $IssData[1]="-"&StringTrimRight($IssData[1],1)
        Else
            $IssData[1]=StringTrimRight($IssData[1],1)
        EndIf
        If StringRight($IssData[2],1)="S" Then
            $IssData[2]="-"&StringTrimRight($IssData[2],1)
        Else
            $IssData[2]=StringTrimRight($IssData[2],1)
        EndIf
        
        $MapMoveForm=_IEFormGetObjByName($oIE,"MapMoveForm")
        $LatInput=_IEFormElementGetObjByName($MapMoveForm,"latInput")
        $LongInput=_IEFormElementGetObjByName($MapMoveForm,"longInput")
        _IEFormElementSetValue($LatInput,$IssData[2])
        _IEFormElementSetValue($LongInput,$IssData[1])
        _IELinkClickByText($oIE,"move")
        Sleep(5000)
    EndIf
WEnd

Func AdlibExiter()
    If ABS(MouseGetPos(0)-$MouseStartPos[0])>5 OR ABS(MouseGetPos(1)-$MouseStartPos[1])>5 Then
        Exit
    Else
        $MouseStartPos=MouseGetPos()
    EndIf
EndFunc
Edit: I'd hard-coded the .html document to be in @DesktopDir. Fixed that, and added a FileInstall so it'd always be there.

GoogleMapsIIS.html

GoogleMapsIIS.au3

Edited by james3mg
"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

I've noticed that the screensaver seems to freeze up after a period of time...I think it's the reloading of the data page after 2 hours. I'll try to get it fixed sometime early this week. I'm also going to try and add PixelSearch functions in so that it will zoom out when only over water until you can see some land, then zoom back in when coming over land again. Stay tuned. :whistle:

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

I would like to make this a screensaver, but i cant seem to rename it with the extension.. when i right-click > rename it doesnt let me change the extension. I dont know why it didnt use to be like this! Anyone know how to fix this? :/

Its cool though, is it supposed to be so dark? or is it just on the other side of the earth :whistle:

Link to comment
Share on other sites

1) To change the file extension, you must either uncheck "Hide extension for known file types" in "Folder Views" (From an explorer window, Tools -> Options -> Views), or you can do it from the command prompt. Start -> run, type

cmd

and press OK. Now using "cd", navigate to the folder the file is in, then type

rename [fileName].exe [fileName].scr

replacing [fileName] with the actual file name, and press Enter. Type

Exit

to close.

2) It's dark when it's on the "night" side of the earth...you should see city lights when there's populated areas around. If you poke around on that website, you can see there's options for using the current weather instead of day/night views, but keep in mind Earth is mostly cloudy, so you'll see a lot of white and usually not much land mass that way :-) Maybe when I'm done poking around with the Google Maps version of the screensaver, I'll go back and add "configure" options to the screensaver so you could pick which globe view you wanted to use.

@Manadar, Thanks :whistle:

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...