Page 1 of 1

NeoIEHistory plugin

PostPosted: Sat May 14, 2016 5:47 am
by fkapnist
I am using the NeoIEHistory plugin by David de Argentina. It has no parameters but returns all the webpages you visited.
I would like to make it more fancy to resemble other browsers:

1. before calling NeoIEHistory I want to record the current date and create a folder with that name (if it does not already exist)
2. I want to send all of the NeoIEHistory results to that folder and then clear the history (today's results will remain in their folder)
3. If I call NeoIEHistory again on the same day, it will simply add more results into today's folder.
4. On the following day (tomorrow) a new folder will be created with the current date before calling NeoIEHistory...
5. I can store up a few weeks that way with every url in the folder of the date it was first visited by the browser.

Hmm... I am wondering just how to do this painlessly and if there is an easier way to produce such an effect...

:|

.

Re: NeoIEHistory plugin

PostPosted: Sat May 14, 2016 2:17 pm
by Gaev
fkapnist:
2. I want to send all of the NeoIEHistory results to that folder and then clear the history (today's results will remain in their folder)

I am assuming that you want to store each url as a separate file in the current day's folder ?

1. before calling NeoIEHistory I want to record the current date and create a folder with that name (if it does not already exist)

Easily doable ... FolderExists and CreateFolder.
2. I want to send all of the NeoIEHistory results to that folder

Isn't it just a matter of parsing the variable contents (one array item per url) ... and then looping through the items and then doing a FileWrite for each item ? ... or am I missing something ?
and then clear the history (today's results will remain in their folder)

Have you tried using SetVar to clear the value of the variable ?
3. If I call NeoIEHistory again on the same day, it will simply add more results into today's folder.

In addition to the afore mentioned "1 file per url", you can (in your pub's exit section) save the contents of the variable in a specially named file in the folder for today (e.g. todayURL.txt) ... and in your start up section, read the contents of the file back into the variable (after you call the plugin).
4. On the following day (tomorrow) a new folder will be created with the current date before calling NeoIEHistory...

FolderExists and CreateFolder should do the job ... in the Start section.
5. I can store up a few weeks that way with every url in the folder of the date it was first visited by the browser.

Not sure what you want done if a website is called on April 10 and again on April 15 ... if you do not want to store the file for it on April 15, before creating each new file, you will need to check for its existence by ...

a) either checking the special files (like todayURL.txt) in each of the folders

b) or using FileExist in each of the Folders
Hmm... I am wondering just how to do this painlessly and if there is an easier way to produce such an effect...
Perhaps the Plugin Author can write the above functionality for you (for a less painful price).

Re: NeoIEHistory plugin

PostPosted: Sat May 14, 2016 7:20 pm
by fkapnist
Gaev wrote:Not sure what you want done if a website is called on April 10 and again on April 15 ... if you do not want to store the file for it on April 15, before creating each new file, you will need to check for its existence...



Thanks. The same website url can be stored on April 10 and again on April 15, to show the day's full activity. It doesn't matter if there are duplicates. I am just trying to estimate how long it will take me to accomplish this and what it will look like

Re: NeoIEHistory plugin

PostPosted: Sun May 15, 2016 6:26 am
by Gaev
fkapnist:

The same website url can be stored on April 10 and again on April 15, to show the day's full activity. It doesn't matter if there are duplicates.

Makes the design even simpler.
I am just trying to estimate how long it will take me to accomplish this and what it will look like

Say ...

1) the folders are of the format EHistoryyyyymmdd

2) the files can take on the url values (this can be a bit tricky if there are characters that NeoBook/Windows does not allow for file names; if possible, just using an incremental number might be preferable)

3) Reserve variable [EHistoryCurrentDateFolder] to contain the value EHistoryyyyymmdd

4) Subroutine design (note: not tested by me, and may require minor tweaks to accomodate special situations or mis-understood requirements)
Code: Select all
:EHistoryAtStartUP
... called from pub's StartUp section
GoSub SetupEHistoryCurrentDateFolder
FolderExists "![EHistoryCurrentDateFolder]" "[EHistoryCurrentDateFolderExists]"
If "[EHistoryCurrentDateFolderExists]" "=" "False"
   ... create one for today
   CreateFolder "![EHistoryCurrentDateFolder]"
   ... start plugin
   ae_IEHistory
Else
   ... start plugin
   ae_IEHistory
   ... read contents of file todayURL.txt into plugin variable
   FileRead "![EHistoryCurrentDateFolder]todayURL.txt" "All" "[ae_IE_History]"
EndIf
Return

:EHistoryUpdateFolder
.. called from pub's ShutDown section
... can also be called anytime during pub's life

... parse the [ae_IE_History] variable into array
StrParse "[Files]" "[#13]" "[EHistoryURL]" "[EHistoryURLCount]"
If "[EHistoryURLCount]" ">" '0"
   ... loop through array items, creating one url file for each item (or replacing file if it already exists)
   Loop "1" "[EHistoryURLCount]" "[thisURLItemNumber]"
      ... separate Page Name & Page URL
      StrParse "[EHistoryURL[thisURLItemNumber]]" "!->" "[thisURLItem]"
      ... create/write file for this url
      .. code here depends on your chosen naming convention for file
   EndLoop
   ... save contents of plugin variable to todayURL.txt
   FileWrite "![EHistoryCurrentDateFolder]todayURL.txt" "All" "![ae_IE_History]"
EndIf
Return

:SetupEHistoryCurrentDateFolder
...
DateToNum "[DateShort]" "Default" "[todayNumber]"
NumToDate "[todayNumber]" "yyyymmdd" "[todayString]"
Setvar "[EHistoryCurrentDateFolder]" "EHistory[todayString]"
Return

Re: NeoIEHistory plugin

PostPosted: Sun May 15, 2016 10:33 am
by Wrangler
You could also name the folders using datetonum. You can then easily convert that back to date format when you needed to. Would also save code if you ever needed to search the folders.

Re: NeoIEHistory plugin

PostPosted: Sun May 15, 2016 4:59 pm
by fkapnist
Aren't the IE History files kept within the AppData Temp folder? If I could read them and make lists it would be easier, but I have access denied when I try to go into those folders

:cry:

.

Re: NeoIEHistory plugin

PostPosted: Sun May 15, 2016 5:03 pm
by fkapnist
Gaev wrote:fkapnist:

The same website url can be stored on April 10 and again on April 15, to show the day's full activity. It doesn't matter if there are duplicates.

Makes the design even simpler.
I am just trying to estimate how long it will take me to accomplish this and what it will look like

Say ...

1) the folders are of the format EHistoryyyyymmdd

2) the files can take on the url values (this can be a bit tricky if there are characters that NeoBook/Windows does not allow for file names; if possible, just using an incremental number might be preferable)

3) Reserve variable [EHistoryCurrentDateFolder] to contain the value EHistoryyyyymmdd

4) Subroutine design (note: not tested by me, and may require minor tweaks to accomodate special situations or mis-understood requirements)
Code: Select all
:EHistoryAtStartUP
... called from pub's StartUp section
GoSub SetupEHistoryCurrentDateFolder
FolderExists "![EHistoryCurrentDateFolder]" "[EHistoryCurrentDateFolderExists]"
If "[EHistoryCurrentDateFolderExists]" "=" "False"
   ... create one for today
   CreateFolder "![EHistoryCurrentDateFolder]"
   ... start plugin
   ae_IEHistory
Else
   ... start plugin
   ae_IEHistory
   ... read contents of file todayURL.txt into plugin variable
   FileRead "![EHistoryCurrentDateFolder]todayURL.txt" "All" "[ae_IE_History]"
EndIf
Return

:EHistoryUpdateFolder
.. called from pub's ShutDown section
... can also be called anytime during pub's life

... parse the [ae_IE_History] variable into array
StrParse "[Files]" "[#13]" "[EHistoryURL]" "[EHistoryURLCount]"
If "[EHistoryURLCount]" ">" '0"
   ... loop through array items, creating one url file for each item (or replacing file if it already exists)
   Loop "1" "[EHistoryURLCount]" "[thisURLItemNumber]"
      ... separate Page Name & Page URL
      StrParse "[EHistoryURL[thisURLItemNumber]]" "!->" "[thisURLItem]"
      ... create/write file for this url
      .. code here depends on your chosen naming convention for file
   EndLoop
   ... save contents of plugin variable to todayURL.txt
   FileWrite "![EHistoryCurrentDateFolder]todayURL.txt" "All" "![ae_IE_History]"
EndIf
Return

:SetupEHistoryCurrentDateFolder
...
DateToNum "[DateShort]" "Default" "[todayNumber]"
NumToDate "[todayNumber]" "yyyymmdd" "[todayString]"
Setvar "[EHistoryCurrentDateFolder]" "EHistory[todayString]"
Return



Thank you for this Gaev!