Published using Google Docs
Final Submission Report
Updated automatically every 5 minutes

Extension:Contributors

Project Name: List Of Contributors

Mentors: Adam Shorland , Niharika Kohli

Introduction

The Google Summer Of Code project with the Wikimedia Foundation titled List of Contributors aimed at developing the Contributors extension which already existed for Mediawiki by making further major changes to it, in order to eliminate the current drawbacks the extension had. The function of the extension is to provide the list of contributors to a page upon giving a request by providing the the name of the concerned page. The main drawback of the extension was that it was not scalable . Each time a request to get the list of contributors was given, it had to recalculate the whole data and then generate a list which proved to be the least efficient way to generate the list. Hence, during the course of this internship I could work on designing a database structure for the extension, add several other features the extension lacked, with the guidance of my mentors.

Features Implemented

Work Done

        A contributors table is created which contains the fields cn_id, cn_page_id , cn_user_id , cn_user_text , cn_last_edit , cn_first_edit , cn_last_edit

                     

        Currently, whenever a revision is made to a page, all the details of the revision including the timestamp of when it was done , who made the change , the user ID of the user , the page ID etc gets stored to the revisions table. This task aimed at creating a script which will fetch all the info from the revisions table and also will count the number of revisions done by  a user to a particular page and then store it in the contributor’s table. The script was written so that a user who has installed the extension for the first time can run the script so that the contributors table gets populated.

        Here I’ve written an event handler for the hook PageContentSaveComplete , which will provide the pageID and the userID whenever a page is edited and then saved. So , the pageID and the userID obtained are then updated to the contributors table.

        Currently the extension’s Special page used to fetch the contributors data from the cache history. Now, as we have a table for the extension which contains all the data of the contributors , I’ve changed the Special:contributors to use the table created so that it can fetch the data from the table.

        This was one of the features proposed in the proposal. It aimed at having a better filter for the contributors data generated. So this will give a checkbox named “Hide IP addresses” in the Special:contributors page and and when it is selected , it will only the contributors with usernames.

        Earlier in the extension , the list of contributors was generated as a  raw list. But now by making use of the TablePager class , the list is generated in the form of a tabular column.

        By making use of the timestamps that is fetched from the revisions table , we can identify when the contributor edited the page first and lastly.

        This will provide a checkbox in the Special:Contributors , which upon selection will provide the contributors to the subpages of a page.

        The Special page enables a user to get the contributors list for a page. But for the bots and scripts to make use of the data , an API module is written.

Result

specialpage.png

Work to be done

There are some more features that needs to be done for the extension . Some of the features that couldn’t be implemented were, having an option to download the list produced in plain text , html and json format. Due to time constraints I could not finish it within the GSoC time period. But I plan to complete it before the end of August with the guidance of my mentors.

Conclusion

I can say without any doubt that this summer was a summer well spent. I got to work with two amazing mentors and got to learn so much from them .It was not only the technical things that I got to learn, but also the etiquettes and mannerisms that a programmer must have. This GSoC has definitely made me a better programmer. I can confidently say that with each task of my project I could see myself improving. All this wouldn’t have been possible if it weren’t for my mentors. Their patience and effort to help me out and make me understand things were commendable. Working on this project has definitely given me a lot of confidence and willpower. I would definitely continue to work  on the project and contribute to the community. :)