Fighting Spam with Browser Automation
Browser Automation is awesome!, I have been working on tones of projects recently, all using browser automation for part or all of the projects' needs. From simple data mining of websites which have no API, to reporting spam, which causes a client of mine to loose some business. Specifically I am stocked about the Anti-SPAM project, as it is the most noble of my projects.
Fighting SPAM, with Bots!
Basically, I wrote a CLI Python application, which uses Selenium to control a browser. It receives a list of Account Ids for OfferUp which are SPAM. Using this list of accounts, it will log in, and then proceed to find accounts from the ID supplied, and report their posts, and then their account. In a single day using this method, I have been able to get about 9 accounts recognized as SPAM, by OfferUp. I opened a Support Ticket and informed OfferUp that I would be spending a significant amount of time reporting SPAM in my area, because I am tired of seeing nothing but SPAM. I did not, however, inform them that I was going to write a python script, to do this for me. (I don't think they will mind much, or I hope they won't)
How does it work?
It is super simple at the moment. I have a CSV file containing a list of IDs which need to be reported. In Python when the script loads, I read that file into an array. Then using Selenium, I load up Firefox, and log into my OfferUp Account. Once the Script has completed the Login, It navigates to the first SPAM Profile, reading in the URLs of the Offers on the account. Then visiting each offer and flagging it. Finally returning to the SPAM profile and flagging the profile also. It was super simple, and when I launch offerup now, it looks so much cleaner :)
How I plan to utilize this in the future.
Now seeing how effective this is, I am planning a project, to "crowd source" spam detection and removal. I am going to build a Chrome, & Firefox extension, which will allow users to easily report spam on any site. If possible, I will write an automation which continues to report the spam to that service, until it is removed. I know this sounds a little spammy itself, but it works. It keeps our online communities cleaner.