' Spot the International Space Station
' Using Vbsedit's free Toolkit

url="https://spotthestation.nasa.gov/sightings/view.cfm?country=France&region=None&city=Paris"
url="https://spotthestation.nasa.gov/sightings/view.cfm?country=United_States&region=North_Carolina&city=Plymouth"
url="https://spotthestation.nasa.gov/sightings/view.cfm?country=Cuba&region=None&city=Havana"

Set http = CreateObject("Msxml2.XMLHTTP")
http.open"GET", url, FALSE
http.send""

data = http.responseText

Dim img
Set img = WScript.CreateObject("Vbsedit.ImageProcessor")

Set objShell = CreateObject( "WScript.Shell" )
resourceLocation=objShell.ExpandEnvironmentStrings("%LOCALAPPDATA%") & "\Vbsedit\Resources\"
    
img.Load resourceLocation & "spacewalk.jpg"

spot=False

y=5
x=5

DoWhile1
  pos1=InStr(data,"<td scope=""row"">")
  If pos1>0Then
    pos2=InStr(pos1,data,"</td>")
    If pos2>0Then
      thedate = Mid(data,pos1+16,pos2-pos1-16)

      
      posday1=InStr(thedate,",")
      If posday1>0Then
        posday2=InStrRev(thedate," ",posday1)
        If posday2>0Then
          theday=CInt(Mid(thedate,posday2+1,posday1-posday2-1))
        EndIf
      EndIf
        
             
      data = Mid(data,pos2+5)

      pos3=InStr(data,"<td>")
      pos4=InStr(data,"</td>")
      If pos3>0And pos4>0Then

        duration=Mid(data,pos3+4,pos4-pos3-4)
        If Left(duration,1)="<"Then
          minutes=0
        Else
          minutes = CInt(Left(duration,InStr(duration," ")-1))
        EndIf
        
        data = Mid(data,pos4+5)

        pos5=InStr(data,"<td>")
        pos6=InStr(data,"</td>")
      
        If pos5>0And pos6>0Then
          maxheight=Mid(data,pos5+4,pos6-pos5-4)
          
          degree=CInt(Left(maxheight,InStr(maxheight,"&deg")-1))
          
          when=""
          
          thetime=Mid(thedate,instr(thedate,", ")+2)
          
          If Day(Date)=thedayThen
            delta=0
            thehour=CInt(Left(thetime,InStr(thetime,":")-1))
            If Right(thetime,2)="PM"Then
              thehour=thehour+12
            EndIf
            If thehour>=Hour(Now) Then
              when="Today at " & thetime
            EndIf
          EndIf
          
          If Day(Date+1)=thedayThen
            when="Tomorrow at " & thetime
          EndIf
          
          For i=2 To4
            If Day(Date+i)=thedayThen
              when=WeekdayName(Weekday(Date+i)) & " at " & thetime
            EndIf
          Next
                  
          If when<>""And minutes>=3And degree>=40Then
                
            spot=True
            
            
            img.FontFamily="Arial"
            img.FontSize = 10
            img.Color="white"
            img.FontStyle=1
            h=img.TextHeight(when)
            w=img.TextWidth(when)
          
            img.DrawText when,x,y
            y=y+h
          EndIf  
        EndIf     
      EndIf
      
      
    Else
      ExitDo
    EndIf
  Else
    ExitDo
  EndIf
  
Loop

If spotThen   
  path = resourceLocation & "spot_iss.png"
  img.Save path

  Set note = img.CreateStickyNote("iss",path)
  note.AddMenuOption"Website","""C:\Program Files\Google\Chrome\Application\chrome.exe"" """ & url & """"
  note.AddMenuOption"Refresh","wscript.exe //B """ & WScript.ScriptFullName & """"
EndIf


search for scripts

VbsEdit contains all these sample scripts!


Download Now!



Download   Home   Scripts

Copyright © 2001-2024 adersοft