ICA Spam Report by Marjolein Katsma
A set of scripts with which an identi.ca member can block spammers and create and send spam reports.
Bookmark and Share

What is this?

ICA Spam Report is a set of scripts with which a member of identi.ca (or a federated site) can automatically gather data about a spammer on identi.ca, create a report, flag and block that spammer, and blok the spammer from a group.

Current version: 0.6 - 2011-04-18

What does it do?

ICA Spam Report gathers data about a spammer from the spammer's profile page:

  • User name and user ID
  • Number of groups the spammer is a member of
  • Average number of dents per day
  • These data are used to compose a report dent addressed to @support and the !spamreport group (configurable)
  • After adding a note to the report the user can send the report on its way
    • Once the report is sent, performs some further actions:

      • Flag, then block the spammer (a 'personal' block); the flag also sends a signal to the site adminsitrators
      • If the user is a 'helper' moderator, the script also silences the spammer; if not, the script simply ignores the absence of the 'Silence' button'
      • Care is taken that an already-reported spammer is not unblocked or unsilenced, so it is safe to re-report a spammer if insufficient action was taken
      • If the user is a group administrator and navigated to the spammer's profile from a group members page, the script will also go back to this page and block the spammer from the group

What do you need?

To use the ICA Spam Report script, you basically need three pieces of software:

  1. The Firefox browser, version 3.0 or higher. Free, open source software.

    Apart from Firefox, you also need 256MB of RAM (512MB recommended) and at least 10 MB of available hard-disk space.

  2. The iMacros Extension for Firefox, version 6.7 or higher (current release is 7.2.0.8). Free (as in beer), but not Open Source.

  3. Download ICA Spam Report - this is a ZIP archive.
    Current version:
    0.6 - 2011-04-18

    The actual ICA Spam Report package.

    Once you've downloaded the archive, extract it into the iMacros 'Macros' folder (for which you've noted the path in the previous step).

    This package consists of 6 files:

    ICA_Spam_Report.js
    a JavaScript script that drives extraction of data, prompts for report note and then drives reporting and flagging etc.
    ICA_User_Data.iim
    iMacros macro that gathers user data for inclusion in report
    ICA_User_SpamReport.iim
    iMacros macro that interactively composes spam report and sends it to addressee(s)
    ICA_User_SpamFlag.iim
    iMacros macro that flags, silences (helpers only) and blocks a spammer
    ICA_User_GroupBlock.iim
    iMacros macro that blocks the spammer from the 'current' group (group admins only)
    LGPLv3.txt
    the text of the license

Once you have extracted the ZIP package(s), you can start iMacros again: you can check whether the files mentioned above are now actually visible in the file list at the top. (If not, go back and repeat the last step!)

How does it work?

ICA Spam Report should always be started from the profile page of a spammer. This is where the core of its action takes place: gathering data about the spammer, creating and sending the spam report, and flagging and blocking the spammer, so you won't hear from them again — unless they are actually (still) sending out notices to groups you are a member of). If you are a 'helper' moderator, the script will also 'silence' the spammer here (futile for a profile spammer, but sometimes they change their mind).

If you are a group admin, the script can also block the spammer from the group. For this, you should first go to the group's members list page. Then, for each member you want to check, click through from there, decide if this member is a spammer, and if so, start the reporting script. The script will always go back one page in the browser history and check if this is a group membership page. Once all the other steps are done, the script will then return to the group page, try to find the spammer on the page again, and then block the spammer. (It is theoretically possible that the group gained new members while the script was running, and the spammer was 'pushed down' to the next page: the script doesn't provide for this and will not find the spammer. In such a case you'll have to do the blocking manually - but you'll have to go back to where the spammer was anyway if you are going through your members list.)

The (JavaScript) file ICA_Spam_Report.js 'drives' the process; when you start it, it first picks up the configuration variables (see Preparation below), and then goes through the steps described above by calling each of four iMacros macros to perform the separate tasks.

To perform the flagging and blocking actions, the script looks for the relevant buttons by their specific name, and continues if it is not found: this mechanism ensures that an already-blocked spammer will not be unblocked, and a silenced spammer will not be unsilenced.

See the following sections for details on how to configure and run the script.

Preparation

Configure the script.

Before you can start to use ICA Spam Report you will need to check and maybe adapt its configuration parameters. For now, you will have to do that by editing a few lines in the configuration section of ICA_Spam_Report.js.

You can do the editing from within iMacros:

  • In Firefox, open the iMacros user interface by clicking the iMacros button (left of the adress bar).
  • In the files list (top half of the side bar), find and highlight the file ICA_Spam_Report.js
  • Then, below that in the tabbed interface select the 'Edit' tab: you will see an 'Edit Macro' button at the top. (If no file is highlighted, the button is disabled.) Press the button to edit the file.
    (The default editor on Windows is Notepad, but if you prefer another editor for editing code, you can configure it via the 'Options' dialog, also found on the 'Edit' tab.)
  • With the file in the editor, scroll down till you find this marker line:
    /* ---------- Configuration ---------- */
    Between that line and the next marker line are 2 variables you can configure (see next step); do not edit anything beyond the next marker line:
    /* ---------- END Configuration ---------- */
  • Make sure you edit only the values (after the = sign); if the value is quoted, leave those quotes, and do not touch the rest of the line!
    1. The timeout value is already set at the default of 60 seconds. However, when the script detects an error situation possibly caused by a timout, you can increase this timeout setting and try again. If you already know you have a slow system and/or slow internet connection, you may want to start with a higher value. See also Timeouts in Known Problems below.
    2. The target variable determines where reports will be sent to. By default this will be:
      @support
      identi.ca support takes care of the reports (hopefully). If you are at a federated site and wish to report a spammer at identi.ca, you can change this to @support@identi.ca
      !sr
      The !spamreport group is addressed via its !sr alias to save space for your report note. You must be a member of a group to address that group so if you wish to include !sr, make sure you have joined the group first! By including !spamreport you can alert group admins and helper moderators who can then check out the spammer in turn and silence and/or ban them from the group (and maybe add an extra report).

When you have made all necessary changes, save the file. iMacros will automatically get the new version.

How to use

Basic operation

To report and block a spammer, this is the normal sequence of actions and events:

  1. Go to the spammer's profile page
  2. Open iMacros (you can use the button, normally to the left of the address bar, or the View -> Sidebar menu, or the F8 shortcut)
  3. Locate ICA_Spam_Report.js in the list of scripts and select it
  4. On the tabbed interface below the list, press the 'Play' button located on the Play tab
  5. The script will first gather data from the user's profile (you can see what it selects on the page to find the necssary data!), then go back in the browser history to check whether that is a group membership page, then return to the profile page
  6. Next, the script composes the start of a report message, starting with the configured addressee(s) and relevant data about the spammer
  7. The script then pops up a dialog, showing the message as composed so far, and an entry field to add your note (your observations are important!); it also tells you how many characters you have available. If you submit and the note you added makes the message too long, the dialog will re-appear giving you a chance to edit your report note. A 'live' character counter isn't possible here, but the dialog does its best by informing you how long your note is, and how many characters you actually have available.
  8. Then sit back: the script will now do as much as it can (report, flag, block, and maybe more), depending on context and what your user rights are!
  9. When the script is done, it will inform you in the iMacros message area. You are now ready to go find another spammer. Or just dent away! ;)

Some tips:

  • Don't worry about whether a spammer has been reported earlier by you or someone else: it may help if no action was taken before, and the script will not unblock or unsilence.
  • It's important that you do not go to another tab while the script is operating: it will work only on the current tab, so don't confuse it! Also do not interfere with the operation of the script by clicking on any button: it is likely to confuse the script (and may not work anyway!)
  • If you're intending to do a series of reports, it can be handy to do this in a separate window. That also makes it easier to temporarily stop reporting, do something else, and then pick up from where you left it.
  • You may also want to check out Known issues for some hints to speed up operation.

Below are some use cases, depending on the type of user you are. But unless you are a group admin, the script's extra features over and above those described above, are entirely automatic.

Known problems

These are currently known problems, and what you may be able to do about them.

Since this section probably will apply to all RedBubble and Identica scripts, this section will be moved to a separate page!

Timeouts

Summary

Puzzling symptoms: Some early testers and users of the first RB Inventory script reported various problems that mystified me at first - especially since I had not seen any of that on my own two machines that I tested on (one reasonably recent an fast machine running Windows Vista, and one very old one running Windows 2000). Only when several reports came in did I start to see a pattern in the various symptoms: batches not completed, but bailing out at a much lower number than the configured loop variable, a page URL not extracted, missing data, the script 'thinking' it had reached the last public image page when it was nowhere near yet... all of those symptoms could actually be caused by a timeout: the iMacros script stopping to wait for a page to load when its (built-in) timeout was reached, and then carrying on trying to get data that simply wasn't there. And as I later realized, it wasn't necessarily the script timing out: a browser has a timeout too...

Problems or bugs?

If you are getting really stuck, or if you think you found a bug, you can contact me at Identica, or via my contact form on RedBubble. The first option is by far the best and you may reach me sooner, but please remember that I do not watch my stream every minute of the day...

Of course, if you have any brilliant ideas for improvement or possible new scripts, also let me know. No guarantees as to feasibility, but I'll certainly consider your valuable suggestions. Or, since it's all Free, Open Source Software, you may want to make your own changes or additions, and share those with the world! Please make sure to actually read the license included in the package before you plan to distribute any modifications!