Re: Automating search for words in a website using WSH

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Hii Sing Chung" <singchung@xxxxxxxxxxx> wrote in message
news:CFDF459F-A608-4A7E-B748-5816775CFDE2@xxxxxxxxxxxxxxxx
These are the processes my team are doing everyday at 6am (the urls and
the words are examples):
1. Got to http://www.phishing.org, check for the presence of word1, word2,
word3, word4, unicodeword5 for today's posting
2. Open up Outlook, send an e-mail using a predefined template, the
subject of the mail: Phishing check result [today's date]. The body text:
There is [0] increase in phishing site.
3. The team member has to enter today's date in the subject and if there
is any increase to the number of match found, change the 0 value.
4. Send the mail.

I am able to automate the part of the composing of e-mail using wsh with
the date variable in the subject. However, I am not able to automate the
process of checking at the particular website, looking for matching words,
and return the number of match found to the wsh to change the 0 value
accordingly. I found that I can do a Google search with the match word
parameter and the date parameter, like this:
http://www.google.com/search?hl=en&rlz=1T4SKPB_enSG318SG319&as_q=&as_epq=&as_oq=word1+word2+word3+%E5%AD%97&as_eq=&num=10&lr=&as_filetype=&ft=i&as_sitesearch=&as_qdr=d&as_rights=&as_occt=any&cr=&as_nlo=&as_nhi=&safe=images.
When putting this string into the url, and Enter, Google will return the
search result. I would like to be able to return this result back to wsh,
as 0, 1, 2, 3, depending on the number of matches. Is there a way to
accomplish this?

Or, is there a better way?

Thanks in advance,

Sing Chung

You could use the batch file below to search for your words It's not script
but it's simple and it works. Note that the text on http://www.phishing.org
changes continuously. The results of the batch file will therefore differ
from one moment to the next.

You can download wget.exe from here:
http://www.interlog.com/~tcharron/wgetwin.html.

[01] @echo off
[02] set words=mobile spyware nader
[03] SetLocal EnableDelayedExpansion
[04] set Result=
[05] set Filename=Phishing.org
[06] if exist "%FileName%" del "%FileName%"
[07] wget http://www.phishing.org/%FileName% -onul
[08] for %%a in (%words%) do (
[09] find /i "%%a" "%FileName%" > nul && set Result=!Result! %%a
[10] )
[11] echo Result=%Result%
[12] pause


.



Relevant Pages

  • Re: about iterative loop to write numbers into file
    ... @ECHO OFF ... I would say first you design an interface ... the script engine that supports inheritance ... Should be a 100% backward compatible to WSH; ...
    (microsoft.public.scripting.vbscript)
  • Re: about iterative loop to write numbers into file
    ... @ECHO OFF ... I would say first you design an interface ... the script engine that supports inheritance ... Should be a 100% backward compatible to WSH; ...
    (microsoft.public.scripting.vbscript)
  • Re: issues with pipe operator causing hang while executing a batch fil
    ... You can hardly in and out the result of a pipe ever efficiently.+ ... use wsh to write the thing to file system and read it back in. ... echo "Iteration %1 " ... It should not have run more than a single iteration due to the lack of CALL ...
    (microsoft.public.scripting.wsh)
  • Automating search for words in a website using WSH
    ... However, I am not able to automate the process of checking at the particular website, looking for matching words, and return the number of match found to the wsh to change the 0 value accordingly. ... I found that I can do a Google search with the match word parameter and the date parameter, like this: When putting this string into the url, and Enter, Google will return the search result. ...
    (microsoft.public.scripting.wsh)
  • Re: batch file question
    ... > this is not a direct wsh question but I know you folks will know it anyway ... > I am calling a wsh vbscript file FROM an existing batch file. ... The problem is I need to suppress error info from ... But is does not stop it from displaying on screen to. ...
    (microsoft.public.scripting.wsh)