Monday, November 14, 2011

HowTo: Pretend you are working (While Text Browsing)

Commandline Web Browser (Just like lynx) using VbScript and IE API.

About the code: The code below will use the Internet Explorer API to load the top 20 stories from google news and choosing one of the article will load the document html of the target URL for you to be able to read news from your DOS command line. Best way to look like you are still working on a code while actually reading news without opening any web browsers :p

Requirements: IE 6++

Code Snippet:

Sub Loadnews()
Dim arrTestArray()
Dim urlSelect
intSize = 0
Dim rInterval:rInterval=60
Dim sTime:sTime = Now
Set ie = CreateObject("InternetExplorer.Application")
with ie
.visible = 0
.navigate "http://news.google.com/"
WScript.StdOut.Write vbcrlf & vbtab & "Loading Top Stories for @ " & Now
while .busy
WScript.StdOut.Write "."
WScript.Sleep 1000
wend
WScript.Echo vbcrlf & vbtab & "elapsed : " & datediff("s",sTime,Now) & " secs"
WScript.Echo vbtab & "next refresh: " & dateadd("s",rInterval,Now) & " secs" & vbcrlf
dim ctr:ctr=1
Set newsTitle = .Document.getElementsByTagName("a")
For each xTag in newsTitle
If instr(xTag.InnerHTML,"titletext") >0 then
WScript.Echo vbcrlf & vbtab & ctr & ". " & xTag.InnerText & _
"..." & vbcrlf & vbTab & "[" & xTag & "]"
ctr = ctr + 1
ReDim Preserve arrTestArray(intSize)
arrTestArray(intSize) = xTag
intSize = intSize + 1
If ctr >20 Then Exit For
End If
Next
end with
ie.quit
Set ie = nothing
Dim sleepctr:sleepctr=1
WScript.StdOut.Write vbcrlf & vbtab & "Choose an article #: "

urlSelect = WScript.StdIn.ReadLine
Set ie = CreateObject("InternetExplorer.Application")
Dim tgt:tgt=arrTestArray(urlSelect-1)
with ie
.navigate tgt
WScript.StdOut.Write vbcrlf & vbtab & "Loading [URL]..." & arrTestArray(urlSelect-1)
while .busy
WScript.StdOut.Write "."
WScript.Sleep 1000
wend
WScript.Echo .Document.Body.InnerText
end with
WScript.StdOut.Write vbcrlf & vbtab & "Press any key to continue..."
jcontinue = WScript.StdIn.ReadLine

End Sub


Screen grab:



If at first you fail, call it version 1.0

Tuesday, May 10, 2011

How can someone so beautiful be so angry?

Have you ever met someone so beautiful... yet so angry?


They are common nowadays... you can't seem to figure out the root of their anger....
Everyone has issues... who doesn't?
If you think you have bigger issues... there will always be someone out there with bigger dilemma...
It's just a matter of squaring it...

I'm blogging again... I must be bored.

After a decade of stfu'd attitude and spontaneous random life turning events...

I look back... what do I see? blurred vision... which is good as I would not want to look back... I just wanna keep moving forward... without hesitation...

Few questions that bogged me and pushed me to blog again... hoping someone from somewhere will somehow comment on my stupidity...

How do you prove your existence?
If you are in the memory of others, whether the past or present...

How do you know how far you've gone?
When you look back and could not find the lines that divides the horizon...
no glimpse of light nor shadow from the past...

How do you know if you've had too many?
When everyone starts ignoring your whining...

Why so many how's?

Well, there are so many hows I want to learn now that I'm back... hopefully in time I could make something out of it...

Hopefully this is more productive than bein' a couch potato watching reruns and the same movies over and over again...

What could I make out of all of this?

Digital blah blah's...