Sign in to follow this  
Followers 0
Blackstar

Spam Filters

7 posts in this topic

Hi, how does one go about creating a spam filters list script for autoit?

What I'm trying to do is:

open a text file called SpamFilters.txt and load up all (in an array perhaps?) with each lines per filter that looks like this:

Make Money!

sell stocks now

iamspamming@you.com

Not satified with your manhood?

Then I have a script to open the email message (from email website that doesnt offer spam filtering) via IE.au3 but how to copy all the text message into clipboard and do match with the SpamFilters.txt list and raise flag?

Can this be done?

Thanks!

Blackstar

Share this post


Link to post
Share on other sites



I made a quick function you could use to see if the specified text contains any of the spammesages you put in the array. Hope this helps

Func _CheckSpam($text)
    For $i= 1 To UBound($spamarray); Or UBound($spamarray)-1, if the first element [0] contains the amount of spammessages to search for
        If StringInStr($text, $spamarray[$i] Then Return 1
    Next
    Return 0
EndFunc

Alzo


Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Share this post


Link to post
Share on other sites

I made a quick function you could use to see if the specified text contains any of the spammesages you put in the array. Hope this helps

Func _CheckSpam($text)
    For $i= 1 To UBound($spamarray); Or UBound($spamarray)-1, if the first element [0] contains the amount of spammessages to search for
        If StringInStr($text, $spamarray[$i] Then Return 1
    Next
    Return 0
EndFunc

Alzo

Ok, how do I open SpamFilter.txt file AND load it up on each line to array? Thanks.

Blackstar

Share this post


Link to post
Share on other sites

Oh and forgot to add for my previous post:

How to get it all the filter words to clipboard and do matching via array? I do not know how to get texts in clipboard to work with array in autoit....what is the correct way to do it?

Share this post


Link to post
Share on other sites

Presuming all different spammessages are on a seperate line, look at FileReadLine and the For...Next loop.

Alzo


Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Share this post


Link to post
Share on other sites

FileReadLine, got it but *how* do u get it to array...can u give me an example please?

Presuming all different spammessages are on a seperate line, look at FileReadLine and the For...Next loop.

Alzo

Share this post


Link to post
Share on other sites

FileReadLine, got it but *how* do u get it to array...can u give me an example please?

Beta = _FileReadToArray()

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0