Re: Automating search for words in a website using WSH
- From: "Pegasus [MVP]" <news@xxxxxxxxxxxxx>
- Date: Sat, 6 Jun 2009 12:46:35 +0200
"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
.
- Follow-Ups:
- Re: Automating search for words in a website using WSH
- From: Tim Harig
- Re: Automating search for words in a website using WSH
- References:
- Automating search for words in a website using WSH
- From: Hii Sing Chung
- Automating search for words in a website using WSH
- Prev by Date: Automating search for words in a website using WSH
- Next by Date: Re: Automating search for words in a website using WSH
- Previous by thread: Automating search for words in a website using WSH
- Next by thread: Re: Automating search for words in a website using WSH
- Index(es):
Relevant Pages
|