• Welcome! The TrekBBS is the number one place to chat about Star Trek with like-minded fans.
    If you are not already a member then please register an account and join in the discussion!

My Mini City

Just curious, how much time do you guys spend visiting the cities? If I hit every city on my master list, and just leave a short comment, I still find I'm spending a couple of hours doing this.

Really makes me wonder how sporteam and others like him do it.
 
Just curious, how much time do you guys spend visiting the cities? If I hit every city on my master list, and just leave a short comment, I still find I'm spending a couple of hours doing this.

Really makes me wonder how sporteam and others like him do it.

I want to know how LONG they've been doing it. They gotta be part of the site development team.

That is a good question about how long they take. Also, how do they catch all the comments before they've disappeared from view?

With the help of a coworker I've got the script about 90% there. I'll share when it's done.
 
I post a comment about 80 to 90% of the time. It take me about 30 to 45 minutes a day. I usually do it late in the afternoon or late in the evening, when I'm just winding down for the day.

I find it fun to come up with different things to post when I visit, but sometimes I can't think of anything!
 
I generally don't leave comments, but I try to make the rounds when I get a chance, which is turning into every couple days or once a week. :(
 
I try to make the rounds when I get a chance, which is turning into every couple days or once a week. :(

Same here. I feel like I'm lucky if I make the rounds to just the Trekkers here, much less the others on my list. Which is why I was asking how long everyone spent doing it-I just don't have hours upon hours to visit my regulars, comment, and hunt out new prospects.
 
Last edited:
I pretty much just hit the TrekBBS folks. I only have about four other cities that I visit and only when I have time. Running down my TrekBBS list takes about 15 minutes for around 20 cities or so.
 
For Windows users, I made a script.

You can copy the text in the quote (at the end) and paste into notepad/textpad and save it as minicity.vbs. You can call it anything really, as long as the extension is .vbs.

1) As written it reads a city list text file (minicity.txt) that is a list of urls. The urls have to look like this:
2) As written it opens Firefox. You can change it to open IE. Look for the comment in the script.

3) When you double click the vbs it reads the city list file and visits the site using /xml. It finds what is needed and shows a message box with the url it's going to visit (if there is nothing at the end it's just doing population). That way you can see what you gave and leave a comment.

4) After it will prompt you to continue to the next city on the list or stop.


Here is the script. I assume no liabilities and this is just for fun. Use at your own risk. If a programmer wishes to make this work better, please do so.


' ---- MiniCity.vbs ----
private sub hitCity(strURL)

'---- get the XML from the minicity site -----

Set web = CreateObject( "WinHttp.WinHttpRequest.5.1" )
web.Open "GET", strURL&"xml", False
web.Send
varByteArray=web.ResponseBody

'----- save it so we can parse it later -----

Const ForReading = 1, ForWriting = 2, ForAppending = 8
strFile="temp.xml"
Set fs = CreateObject("Scripting.FileSystemObject")
Set ts = fs.OpenTextFile(strFile, ForWriting, True)
strData = ""
strBuffer = ""
For lngCounter = 0 to UBound(varByteArray)
ts.Write Chr(255 And Ascb(Midb(varByteArray,lngCounter + 1, 1)))
Next
ts.Close

'---- parse xml ----

set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("temp.xml")

highest_nodename=""
highest_text="0"
for each x in xmlDoc.documentElement.childNodes



'----------------- ADD MORE CHECKS HERE IF NEEDED ---------------------



if lcase(x.nodename)="criminality" and x.text > highest_text then
highest_nodename=x.nodename
highest_text=x.text
end if
if lcase(x.nodename)="unemployment" and x.text > highest_text then
highest_nodename=x.nodename
highest_text=x.text
end if
if lcase(x.nodename)="pollution" and x.text > highest_text then
highest_nodename=x.nodename
highest_text=x.text
end if
if lcase(x.nodename)="transport" and x.text < "100" then
highest_nodename=x.nodename
highest_text=100-x.text
end if
'msgbox(x.nodename&": "&x.text)
next

'msgbox(highest_nodename)

'---- Go to the URL required ---
dim typeofhelp
typeofhelp = ""
if lcase(highest_nodename)="criminality" then typeofhelp="sec"
if lcase(highest_nodename)="unemployment" then typeofhelp="ind"
if lcase(highest_nodename)="pollution" then typeofhelp="env"
if lcase(highest_nodename)="transport" then typeofhelp="tra"
goToURL=strURL&typeofhelp

' ---- Message box! ----
msgBox("Visting: "&goToURL)

' ---- Open the site ----
Set WshShell = WScript.CreateObject("WScript.Shell")

' ---- Choose Firefox or Internet Explorer by moving the apostrophe ----
WshShell.Run "firefox "&goToURL
'WshShell.Run "iexplore "&goToURL

' ---- delete temp file ----

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("temp.xml")


end sub

' ---- Start Here ----
Const ForReading = 1, ForWriting = 2, ForAppending = 8

' ---- You can change the filename and location here. ----
strCityFile="minicity.txt"

Set fs2 = CreateObject("Scripting.FileSystemObject")
Set ts2 = fs2.OpenTextFile(strCityFile, 1, True)
do while not ts2.atendofstream
strCityData = ts2.readline
hitCity(strCityData)
choice=msgbox("Visit the next city?",VbOKCancel)
if choice = 2 then
WScript.Quit
end if
loop
msgbox("All done")

' ---- Time to tidy up ----
ts2.close
set ts2=nothing
set fs2=nothing
I've found this simply speeds up the process.

:)
 
Last edited:
Nifty! I'm a brave guy, so I'll have to give it a shot. Probably not until Monday though since tomorrow is Father's Day.
 
Went around and hit everyone's city, but didn't leave comments for anyone. I'm being lazy today because it's Father's Day.
 
If you are not already a member then please register an account and join in the discussion!

Sign up / Register


Back
Top