One form of spam that drives me nuts, is form/comment spam. Some time ago I started collecting the ip addresses of spammers who abuse web forms at galaxygoo. The ip address of the spammer is included in the body of the email.
To extract this data, I've been tinkering with Mathematica. Below, is a snapshot of what my code currently looks like. It imports from a mailbox, where I've saved the spam, and extracts the string for the ip address from the body of email.
The syntax of Mathematica is a bit different from other languages I've worked with, and I'm constantly learning. I'm sure there are much better ways to do this, but this is what I have so far.

Working with Mathematica differs from programming with a compiler, since in Mathmatica you run one "line" of code at a time. Where I would comment out a line in ActionScript when testing, in Mathematica I can run each line indepenently. Just click on the line, and execute it. So the structure of a Mathematica document can be a little different than code writen to be compiled and run all at once.
I've added numbers, since the notebook doesn't have line numbers in the code. At (1), what I've done is use the string "ip address: " and told Mathematica to extract the string following it from the body of the email messages in the mailbox.
Now that I've extracted the ip addresses from all the email messages in the mailbox, I can drop the string "ip address: ", which is what the lines at (2) do.
While line (3) isn't needed, for the project, it's kind of cool that we can look at the available elements of the contents of mailbox.
In line (4) I extract the dates, and then interpolate them with ip addresses in line (5). This results in something like a shuffled deck of cards, where every other element in the resulting array is an "ip address".
To break these out into paired elements, I use line (6). The whole thing can be exported in XML, which is in mathML format with line (7).

2 comments:
heyy sexyy (:
i figured out how to do iitt hahhahaa (:
heyy sexyy (:
i figured out how to do iitt hahhahaa (:
Post a Comment