| View previous topic :: View next topic |
| Author |
Message |
ifen
Joined: 13 Aug 2009 Posts: 12
|
Posted: Thu Aug 13, 2009 4:09 pm Post subject: Plugin request : Also save the pdf file on my hard drive |
|
|
Plugin request: Also save the pdf (or xls...) file on my hard drive when change is detected
Hello,
I would be very thankful if there is a "Basic" programmer overhere who can helps me program that !
Martin advised me to write a private plugin myself so Website-Watcher could check if a pdf file has changed and then save it into my hard drive by adding a predefined name.
Example:
url = http://www.sedl.org/scimath/pasopartners/pdfs/health.pdf
Website-Watcher can monitor changes by screenshot (and sending the result by email) but also at the same time save the pdf file in a folder :
For instance:
C:\wsw\2009_08_13_health.pdf
In this case the pdf file could be renamed by adding at the beginning of its name the current date and hour.
Martin advised me :
| Quote: | If you monitor PDF files you could do that by writing your own Plugin.
Within the Plugin, you can use the function
sub Bookmark_SaveWebDocBinary(Handle, sFilename As String)
to save the PDF file to any filename you want. |
Alas, even after reading about it, I don't understand much of the "basic" language, so any help would be welcomed.
Thanks in advance,
ifen |
|
| Back to top |
|
 |
ifen
Joined: 13 Aug 2009 Posts: 12
|
Posted: Fri Oct 09, 2009 2:33 pm Post subject: |
|
|
Hello,
Does anyone have any idea on how to do this ?
Thanks in advance  |
|
| Back to top |
|
 |
Martin Aignesberger Site Admin

Joined: 11 May 2005 Posts: 4884
|
Posted: Thu Oct 15, 2009 4:13 pm Post subject: |
|
|
Just to let you know that we have plans to simplify it in WebSite-Watcher 5.2.0. Then there will be no need to change the original PDF plugin. _________________ Martin Aignesberger [SUPPORT] |
|
| Back to top |
|
 |
ifen
Joined: 13 Aug 2009 Posts: 12
|
Posted: Thu Oct 15, 2009 4:30 pm Post subject: |
|
|
Hello,
If this means there will be a file downloader inside Website-Watcher for each bookmark (saving the file(s) on a specified path in the hard drive), I would be very pleased indeed.
Do you have any rough idea when version 5.2.0. will be ready ?
Thanks in advance  |
|
| Back to top |
|
 |
Martin Aignesberger Site Admin

Joined: 11 May 2005 Posts: 4884
|
Posted: Fri Oct 16, 2009 8:05 am Post subject: |
|
|
| Quote: | | If this means there will be a file downloader inside Website-Watcher for each bookmark |
No, this is not what it means, you will still need the Plugin system. But you can solve your problem with 3 lines of code, independently from assigned Plugins.
| Quote: | | Do you have any rough idea when version 5.2.0. will be ready ? |
No ETA yet, sorry. _________________ Martin Aignesberger [SUPPORT] |
|
| Back to top |
|
 |
ifen
Joined: 13 Aug 2009 Posts: 12
|
Posted: Fri Oct 16, 2009 8:29 am Post subject: |
|
|
Hello Martin, Thank you for answering. Keep up the good work.  |
|
| Back to top |
|
 |
watchdog
Joined: 16 Jul 2009 Posts: 13
|
Posted: Thu Feb 04, 2010 8:28 am Post subject: |
|
|
Martin,
can you give un update.
How can this be done now with the new version? |
|
| Back to top |
|
 |
Martin Aignesberger Site Admin

Joined: 11 May 2005 Posts: 4884
|
Posted: Thu Feb 04, 2010 10:38 am Post subject: |
|
|
To save the original PDF file when an update was detected, you can use the following Private Plugin:
| Code: | Sub Wsw_ActionsOnUpdate(Handle, iUpdateStatus, ByRef sStatusMessage, ByRef iStatusCode)
' iUpdateStatus ... 1 = initialized, 2 = updated, 3 = error
' iStatusCode ... 0 = no error (default), 1 = error
If iUpdateStatus = 2 Then
Bookmark_SaveWebDocBinary(Handle, "c:\folder\filename.pdf")
End If
End Sub |
Starting with version 2010, Private Plugins can coexist with Shared Plugins and used to save the original file. In that code you have to change the target location and filename. _________________ Martin Aignesberger [SUPPORT] |
|
| Back to top |
|
 |
ifen
Joined: 13 Aug 2009 Posts: 12
|
Posted: Thu Apr 01, 2010 1:51 pm Post subject: |
|
|
Hello Martin,
Thanks.
I have tried to peruse in the script help file (http://www.aignes.com/wswhelp/index.htm?help_plugins_eventfunctions.htm) about how to add automatically the current checking date+time of the pdf file name (see example in my first message for this thread).
I guess I have to use these :
ExtractFileName
MonthName
WeekdayName
Year
But I have no clue about how to insert them in your code.
Thanks in advance  |
|
| Back to top |
|
 |
Martin Aignesberger Site Admin

Joined: 11 May 2005 Posts: 4884
|
Posted: Fri Apr 02, 2010 11:41 am Post subject: |
|
|
I would recommend to use the function FormatDateTime to add date/time to the filename.
For example:
| Code: | | Bookmark_SaveWebDocBinary(Handle, "c:\folder\filename " + FormatDateTime("yyyy-mm-dd hh-nn-ss", Now) + ".pdf") |
_________________ Martin Aignesberger [SUPPORT] |
|
| Back to top |
|
 |
ifen
Joined: 13 Aug 2009 Posts: 12
|
Posted: Fri Apr 02, 2010 12:15 pm Post subject: |
|
|
Thanks Martin !
The code becomes :
| Code: | Sub Wsw_ActionsOnUpdate(Handle, iUpdateStatus, ByRef sStatusMessage, ByRef iStatusCode)
' iUpdateStatus ... 1 = initialized, 2 = updated, 3 = error
' iStatusCode ... 0 = no error (default), 1 = error
If iUpdateStatus = 2 Then
Bookmark_SaveWebDocBinary(Handle, "c:\folder\filename " + FormatDateTime("yyyy-mm-dd hh-nn-ss", Now) + ".pdf")
End If
End Sub |
|
|
| Back to top |
|
 |
|