Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IE History Extractor

Posted on 2000-02-22
5
Medium Priority
?
291 Views
Last Modified: 2010-05-02
Hello,  I am trying to make a program that will go through the entire contents of the IE history folder (in the directory of a user profile) and extract the URLs to a text file.  Does anyone have any idea how to do this.  Thanks
0
Comment
Question by:volodya16
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 2546681
Yeah, did it a while ago in QBASIC. Lemme look around for the code...

M
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2546698
FOUND IT!

' =====================================
'
' Program to decode NETSCAPE.HST files
'
' By:   Mark M. Lambert on October 11, 1996
' This program produced with public funds and is therefore
' property of:
' United States Department of Defense
' US Army, STRICOM - UNCLASSIFIED
'
' =====================================
'
' Revision History:
' V1.01 - 14 Oct 96 - MML - Make it take file from command line
' V1.0  - 11 Oct 96 - MML - Initial Code
'
' =====================================
'
' This program will examine a binary NETSCAPE.HST file and do
' it's best to convert it into ASCII. The goal is to be able to tell
' what web sites a user has been visiting.
'
' Examination of a NETSCAPE.HST file shows it as a binary file with
' lots of HTTP:// references in it in ASCII. What we'll do is shuffle
' thru the file dropping out non-ASCII and watching for HTTP in the
' data stream. Every time we hit one we start a new line in the output
' file. Don't know waht exactly that will give us, but we've got to
' start somewhere.
'
' =====================================
'
' These subs were generated with the SUBSET.BAS program and are in
' the MARKSLIB.LIB sublibrary
'
DECLARE SUB cursor (row!, col!, text$)
DECLARE SUB center (row!, text$)
DECLARE SUB box (text$)
DECLARE SUB big.box (hi!)
DECLARE SUB menu (hi!, text$)
'
DECLARE FUNCTION getkey$ ()
'
COMMON urhc$, ulhc$, lrhc$, llhc$, hb$, vb$, tt$, bt$, rt$, lt$, cx$
COMMON xwide, top$, side$, horz$, bot$, cr$, lf$, ff$, esc$, bell$
'
urhc$   = CHR$(187)
ulhc$   = CHR$(201)
lrhc$   = CHR$(188)
llhc$   = CHR$(200)
hb$     = CHR$(205)
vb$     = CHR$(186)
tt$     = CHR$(203)
bt$     = CHR$(202)
rt$     = CHR$(185)
lt$     = CHR$(204)
cx$     = CHR$(206)
xwide   = 77
top$    = ulhc$ + STRING$(xwide, hb$) + urhc$
side$   = vb$ + STRING$(xwide, " ") + vb$
horz$   = lt$ + STRING$(xwide, hb$) + rt$
bot$    = llhc$ + STRING$(xwide, hb$) + lrhc$
cr$     = CHR$(13)
lf$     = CHR$(10)
ff$     = CHR$(12)
esc$    = CHR$(27)
bell$   = CHR$(7)
'
CONST   Zero = 0
CONST   False   = zero
CONST   True    = not false
'
width lprint 255
if instr( ucase$( environ$( "CRT" ) ), "M") = zero then color 7, 1
on error goto trap
'
main:
'
' Get file name from command line and make sure it makes sense
'
filename$ = ucase$( ltrim$( rtrim$( command$ ) ) )
'
' Strip any extension
'
dotmark = instr( filename$, "." )
if dotmark > zero then filename$ = left$( filename$, dotmark -1 )
'
' Reject fancy
'
if instr( filename$, "*") then goto drain
if instr( filename$, ":") then goto drain
if instr( filename$, "?") then goto drain
if instr( filename$, "\") then goto drain
if instr( filename$, "/") then goto drain
'
' Well, we've rejected all forms of trash, check for nothing passed in
'
if ( len( filename$ ) < 1 ) or _
   ( len( filename$ ) > 8 ) then filename$ = "NETSCAPE"
'
on error goto drain
open filename$ + ".HST" for binary as #1
open filename$ + ".LOG" for binary as #2
on error goto trap
'
' Ok, we've got the file, lets start looking for markers.
' We really need a sliding window for the markers
'
if eof(1) then goto done
'
' This is the core part of STRIPPER.BAS converted to run a byte at a
' time. We need to have a sliding window watching the character stream
' and queue up four characters at a time
'
marker$ = "HTTP://"
window$ = ""
'
main.loop:
        s.in$   = " "
        if eof(1) then goto done
'
' Reverse sequence for last record
'
        get #1,, s.in$
'
        if (s.in$ = "") then goto done
'
        byte%   = asc(s.in$)
'
' Only allow printable ASCII & limited control thru
'
        if (((byte% >= 32) and (byte% < 127))) then
                window$ = window$ + chr$( byte% )
'
' Save stripped record
'
                if len( window$ ) > len( marker$ ) then
                        lastchar$ = left$( window$, 1 )
                        window$ = right$( window$, len( window$ ) -1 )
                        window$ = ucase$( window$ )
                        if window$ = marker$ then
                                put #2,, cr$
                                put #2,, lf$
                                goto main.loop
                        endif
'
                        put 2,, lastchar$
                endif
        endif
'
'        if (byte%  = 13) then
'                put #2,, cr$
'                put #2,, lf$
'        endif
'
        goto main.loop
'=================

done:
put #2,, cr$
put #2,, lf$
close
'
drain:
SYSTEM
' =====================================
'
' Subroutines:
'
' =====================================
'
' Routine:      
' Pass:        
' Returns:
'
RETURN
' =====================================
'
' Routine:      TRAP
' Here on any unexpected error
'
TRAP:
PRINT "Internal Error #";err;" has occurred!"
RESUME DRAIN
' =====================================
' =====================================
'
' Fin
'
' =====================================
' =====================================
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2546779
This might help you a little bit.

"Retrieving the Internet Cache with FindFirst/NextUrlCacheEntry"
http://www.mvps.org/vbnet/code/fileapi/findfirstcacheentry.htm
0
 
LVL 14

Accepted Solution

by:
mcrider earned 600 total points
ID: 2546908
0
 

Author Comment

by:volodya16
ID: 2560578
Looks like exactly what I need - the only thing is when I run it I get "runtime error '9': subscript out of range" at this part:

sURLs(iURLCount) = Mid$(sData, i + iDisplacement, j - (i + iDisplacement))

Since I didn't write the code I would strain myself trying to figure out how the array is set up - I'm still a beginner :).  But if you have any ideas I am definitely listening!!!  Thanx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question