Code: Selecteer alles
Dim oCS : oCS = "Driver={SQLite3 ODBC Driver};Database=@FSPEC@;StepAPI=;Timeout="
Dim oCNCT : Set oCNCT = CreateObject( "ADODB.Connection" )
Set WSHShell = WScript.CreateObject("WScript.Shell")
LocalAppData = WSHShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Local AppData")
sFina = LocalAppData + "\Spotlite\Spotlite\spots.db"
oCS = Replace( oCS, "@FSPEC@", sFina )
oCNCT.Open oCS
Dim sSQL, oRS, nRec, oFld
Function HTTPGet(URL)
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = 0
IE.navigate URL
do while IE.Busy
loop
HTTPGet = IE.document.documentelement.innertext
IE.quit
Set IE = Nothing
End Function
sSQL = "CREATE INDEX IF NOT EXISTS msgidx ON spots(msgid)"
Set oRS = oCNCT.Execute ( sSQL )
ArrFileLines = Split(HTTPGet("http://spot-net.nl/add-ons/spamremover/banusers.txt"), vbNewLine)
sSQL = "DELETE FROM foes WHERE reason='Auto-added' "
Set oRS = oCNCT.Execute( sSQL )
For Each strLine in arrFileLines
sSQL = "INSERT INTO foes VALUES('" + strLine + "', 'Auto-added', 'Auto-added')"
oCNCT.Execute( sSQL )
Next
ArrFileLines = array()
ArrFileLines = Split(HTTPGet("http://spot-net.nl/add-ons/spamremover/banmessages.txt"), vbNewLine)
iRemoved = 0
For Each strLine in arrFileLines
if Len(sSQL) > 20 then
sSQL = "SELECT * FROM spots WHERE msgid LIKE '" + strLine + "' "
Set oRS = oCNCT.Execute( sSQL )
iRemoved = iRemoved + oRS.Fields( 0 ).Value
sSQL = "DELETE FROM spots WHERE msgid LIKE '" + strLine + "' "
oCNCT.Execute( sSQL )
iRemoved = iRemoved + 1
end if
Next
oCNCT.Close
Set oCNCT = Nothing
WScript.Echo "Ban-systeem is bijgewerkt! Er zijn " & iRemoved & " spots verwijderd."
Wil je mensen nomineren voor de blacklist, meld hun dan in dit topic : viewtopic.php?f=6&t=1279
Dit script is gemaakt voor, en getest op Windows 7.
Om dit script te draaien moeten de ODBC-sqlite drivers geinstalleerd zijn van deze site geinstalleerd zijn : http://www.ch-werner.de/sqliteodbc/