1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| Option Explicit
Dim Titre,URL,ie,Ws,Question,Data,objRegex,Match,Matches,i
Titre = "Notification de Giveawayoftheday © Hackoo © 2013"
URL = "http://fr.giveawayoftheday.com/"
Set ie = CreateObject("InternetExplorer.Application")
Set Ws = CreateObject("wscript.Shell")
ie.Navigate(URL)
ie.Visible=false
DO WHILE ie.busy
wscript.sleep 100
LOOP
Data = ie.document.documentElement.innerHTML
ie.Quit
Set ie = Nothing
Question = MsgBox(RegExp("<title>(.*)</title>",Data)& vbcr & vbcr &_
" Le temps restant est : " & RegExp("<!--mfunc-->(.*)<!--/mfunc-->",Data)& vbcr & vbcr &_
"Voulez-vous accéder au site : ""http://fr.giveawayoftheday.com"" ?",VBYesNO+VbQuestion,Titre)
If Question = VbYes then
Ws.Run "http://fr.giveawayoftheday.com/",1,False
else
Wscript.Quit
end if
Function RegExp(Motif,Data)
Set objRegex = new RegExp
objRegex.Pattern = Motif
objRegex.Global = False 'une seule instance
objRegex.IgnoreCase = True 'Ignorer la casse
Set Matches = objRegex.Execute(Data)
If Matches.Count > 0 Then
Set Match = Matches(0)
If Match.SubMatches.Count > 0 Then
For i = 0 To Match.SubMatches.Count-1
RegExp = Match.SubMatches(i)
Next
End If
End If
Set Matches = Nothing
Set objRegex = Nothing
End Function |
Partager