Bot watchers - freedom of comment

    Introduction


    Commenting on articles in the media and blogs has long been a habit.
    Comments are a convenient tool for exchanging opinions between readers, establishing feedback with the author and the ability to reflect alternative points of view, etc. Separately, it is worth noting that comments have a significant impact on the perception and evaluation of the information provided in the article.
    All this works provided that adequate users respecting each other’s opinions participate in the process on equal terms.
    However, there are individuals who are not ready to play by the general rules. They are not ready to get along with the fact that normal users peacefully exchange opinions and information. These individuals also have sufficient resources to upset their balance. They set bots and Putin Jugend against peaceful commentators. The balance is thus violated. Due to material resources, one who has one vote gets the opportunity to significantly greater influence on public opinion.

    A tool is needed that would restore balance. Creating a distributed system that is maximally protected from attacks based on the principles of crowdsourcing could have a significant impact on the balance of power. The essence of the idea is simple - to give users the opportunity to combine their efforts aimed at combating bots and allow themselves to regulate the community.
    In contrast to the current practice of authoring comment moderation, in which each author is forced to independently clean bots from comments, the proposed approach will significantly increase the efficiency of the process (a bot marked by one user is automatically identified on all other resources). A distributed system will provide an opportunity for many users to combine their efforts and, if not completely restore their balance, then at least complicate the lives of these individuals by increasing the average comment costs.

    Description

    The application is implemented as an extension for the Chrome / Chromium browser. Only livejournal.com is currently supported. The application downloads a list of indexes created by users from the central repository. The user can select an index from the list based on the description given. The selected list is downloaded from the user repository. The list is a text document in json format.
    The parser parses the comments on the page. If you match the list, the comment is marked.
    Currently, only github is supported for storing indexes. It is clear that this is not enough to ensure reliable operation and resistance to attacks. However, with an example implementation for github, you can develop support for other repositories.
    The user can create their own bot index. A pull request is automatically generated on the created index to add to the general list of indexes.

    Examples

    The extension offers a number of tools to identify suspicious commentators. This toolkit is easy to extend with its own algorithm.

    To do this, in the handler / ljsitehandler.js file, you first need to add a button with a call to the filter function

    Example:
    this.addControl("action_quick_comments_sum_60", "∑=60 sec", this, this.filterTooQuickCommentesSum, 60);
    


    Where:
    "action_quick_comments_sum_60" - id Buttons
    "∑ = 60 sec" - Label for
    this button - scope
    this.filterTooQuickCommentesSum - filter function
    60 - parameter passed to the filter function (optional)

    Example of a filter function:
    filterTooQuickCommentesSum: function (delay) {
    	var commentsMap = this.buildUsersGroups();
    	this.suspects = [];
    	//calculate elapsed time for comments 
    	for(var uname in commentsMap) {
    		var ctime_ts = commentsMap[uname];
    		if (ctime_ts.length > 1){
    			var sum = 0;
    			var lastComment = ctime_ts[0];
    			for (var i = 0; i < ctime_ts.length; i++){
    				sum += ctime_ts[i] - lastComment;
    				lastComment = ctime_ts[i];
    			}
    			if ((sum/ctime_ts.length) < delay){
    				if (!_.contains(this.suspects, uname)){
    	                this.suspects.push(uname);
    				}
    			}
    		}
    	};
    	console.log("list of suspects:" + this.suspects);
    	this.markSelectedUsers(this.suspects);
    }
    

    We save, reload the extension in chrome: // chrome / extensions /, test. If you want to share with others, do fork / pull request.

    As stated above, the application currently only supports LiveJournal. But that too is easy to change.

    In the manifest.json file we add the page of support which you want to add
    ...
    "content_scripts": [
    ...
        "matches": ["http://*.livejournal.com/*", "http://*.ваш.любимый.сайт/*"],
    ...
    


    Take ljsitehandler.js as a template, copy and make changes to support your favorite page. To do this, you have to rewrite the jQuery selectors.

    In the file content_script.js in line 11 we add the ability to select the parser based on the address of the loaded page.

    In manifest.json, in the content_scripts / js section, add a new parser. We reload the extension in chrome: // chrome / extensions /, test it.

    Ready to try it?
    The application is here xreader.github.com/Bot_watchers . There you can also find detailed step-by-step instructions for installation.
    PS JS is not my native language, I ask for leniency.

    Also popular now: