Getting 2600 the Safe Way

by daColombian  (jmwco@blazemail.com)

According to my family, I am a very paranoid person.

I really don't think I am paranoid; rather, I classify myself as "careful."

One of the things that I tend to be careful about is purchasing the latest 2600 Magazine.  While I truly believe that the 2600 staff protects the identities of their subscribers, I live in a very small town where everyone knows everyone's business and I can only imagine the uproar that the arrival of 2600 would cause.

So in order to protect the "peace," I have been relegated to going to a bookstore in another town to purchase it (with cash).  The biggest problem with this method is being able to know when the new issue is released.  I have to periodically stop by the aforementioned bookstore and check to see if the new issue is out.  This quickly became troublesome due to the distances involved.  So I had to look for another answer.

I started by checking the 2600 website every day at work (because I only have dial-up at home) but even that was troublesome because the network admin is one of them "ass-backwards" folks who thinks "hacker" is a dirty word and would have made my life miserable if they found out.

What I needed was a way to view the cover image without logging any suspicious activity.

So what I ended up doing was writing a small ASP page (see code below) that would grab the cover image of the latest issue from the 2600 website and display it so that I would know instantly when the new issue was out.

This would allow me to know this by only going to my personal website.  Basically the page takes a given URL, searches for a given token, and then returns the associated image as a link to go to that page.

As you can see from the sample code, I also get a couple of other images for my reading pleasure.

Good luck, stay safe, and keep your powder dry...

getting-2600.asp:

<%
Option Explicit
On Error Resume Next
Dim oHttp, sTemp, iComic, iStart, iEnd, aUrls(3), aSrch(3), aComics(3), a
Set oHttp = CreateObject("Msxml2.ServerXMLHTTP.3.0")
aUrls(0) = "http://www.2600.com/"
aSrch(0) = "images/covers"
aUrls(1) = "http://www.dilbert.com/"
aSrch(1) = "TODAY'S COMIC"
aUrls(2) = "http://www.gocomics.com/thequigmans/"
aSrch(2) = "comics/tmqui"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Comics page</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<table width=590 cellspacing=5 cellpadding=5>
<tr><td class='linetop' colspan=4 align=left valign=bottom>Comics</td></tr>
<%
' loop through all of the URLs in the array
For a = 0 to Ubound(aUrls) - 1
	aComics(a) = ""
	' get the text from the given page
	sTemp = getLink(aUrls(a), oHttp)
	' if there is text
	If Len(sTemp) > 0 Then
		' look for the token
		iComic = InStr(UCase(sTemp), UCase(aSrch(a)))
		If iComic > 0 Then
			' look for the image tag
			iStart = InStrRev(UCase(sTemp), "<IMG", iComic)
			If iStart > 0 Then
				' look for the closing > of the image tag
				iEnd = InStr(iStart, sTemp, ">") + 1
				If iEnd > 0 Then
					' get the image tag text
					aComics(a) = Mid(sTemp, iStart, iEnd - iStart)
					' replace the src with one pointing to the originating website
					If InStr(aComics(a), "SRC=""/") > 0 Then
						aComics(a) = Replace(aComics(a), "SRC=""/", "SRC=""" & aUrls(a))
					ElseIf InStr(aComics(a), "SCR='") > 0 Then
						aComics(a) = Replace(aComics(a), "SRC='", "SRC='" & aUrls(a))
					Else
						aComics(a) = Replace(aComics(a), "SRC=""", "SRC=""" & aUrls(a))
					End If
					' write the image tag out with a hyperlink to the originating website
					Response.Write "<tr><td align=center><a href=""" & aUrls(a) & """>" & aComics(a) & "</a></td></tr>" & vbcrlf
				End If
			End If
		End If
	End If
Next
%>
<tr><td class='linebottom' colspan=4 align=center valign=top>&nbsp;</td></tr>
</table>
</body>
</html>
<%
Function getLink( sUrl, oHttp )
	Dim RefPage
	On Error Resume Next
	getLink = ""
	' open the url
	oHttp.Open "GET", sUrl, False
	If Err.Number = 0 Then
		'send the request
		oHttp.Send
		If Err.Number = 0 Then
			' get the response
			RefPage = oHttp.responseText
			' return the response if the page is found
			If InStr(RefPage, "NOT FOUND" ) = 0 Then getLink = RefPage
		End If
	End If
End Function
%>

Code: getting-2600.asp

Return to $2600 Index