PROPOSAL FOR TASK
“ARTICLE REMINDER” ON MEDIAWIKI
Phabricator Task Link: https://phabricator.wikimedia.org/T161364
Contents
Personal Information
Mentors
Task Description
Deliverables
Timeline
Implementation
Other Commitments
PERSONAL INFORMATION
Name: KAYODE, Adedayo Matthew
Email Address: adedayomatt@gmail.com
Institution: Federal University of Agriculture, Abeokuta
http://www.unaab.edu.ng
MediaWiki Username : Adedayomatt
Phabricator Username: Adedayomatt
Meta-wiki link: https://meta.wikimedia.org/wiki/User:Adedayomatt
MENTORS
Moriel Schottlender
Matthew Flaschen
TASK DESCRIPTION
This task “Article Reminder” aims at improving the Mediawiki notifications; allowing logged in users to get a reminder of an article after a few days.
DELIVERABLES
PHP scripts
JavaScript source code
A sample of the implementation
TIMELINE
Coding Period: May 30, 2017 – August 21, 2017 (According to GSoC ’17 Timeline)
Total Number of weeks: 12 weeks
Average coding hours: 28 hours/week
IMPLEMENTATION
There would be need to the get the user reminder preference (i.e. X day to be reminded of the particular article). This X days would be converted to a Timestamp using the time function in php. For example, if a user wants to be reminded about an article in X days, the Timestamp of the next X day(s) would be:
<time() + (X*86400)/>
Using cookie to store users’ reminder preference would not be efficient enough because user can change browser at any time, and this data would be lost, therefore there would be need to store the user’s reminder preference and it’s associated data in a database on the server. For this reason, a new table would be created on the database with the following columns:
Reminder_ID
User_ID
Article_ID
Reminder_time
Article_Title
Article_Link
Reminder_status
Important Note: 1. The Reminder_ID column would be the Primary key for the table.
- Foreign key would be added to User_ID column and the “User ID column” on the the “users table” would be referenced, so that if for any reason, the user account is deleted or updated, it also reflect on the reminder table too.
- Reminder_time column would be an integer column that takes the Timestamp of when the user should be notified.
- Reminder_status would only be having two possible values: ‘pending’ or ‘reminded’
‘Pending’ indicates that the time for the reminder has not elapsed while ‘reminded’ indicates the opposite.
At the beginning of every page loaded by the user, all the pending reminders are fetched from the database, then a JavaScript function would be use on each of the user’s reminder to count down remaining seconds before the user is notified, when the remaining seconds hit Zero and the user is currently online, an XMLHttpRequest object would instantiated to fetch the reminder details from the database asynchronously (i.e. without leaving the current page where the user is), a notification can then be added by manipulating the notification area element on the current webpage the user is.
If the remaining seconds is negative, then it means the user was not logged in or online when the time elapsed, the notification can also be sent and let the user knows the time the reminder was sent (by formatting Reminder_Time in mm,dd hh:min)
The php script that fetch the reminder when the remaining time hits Zero or a negative value would also update the table and set the Reminder_Status column corresponding to the reminder as ‘reminded’ immediately after the successful fetching of the reminder and notifying the user.
One may wonder, how would these JavaScript keep counting down the remaining seconds on every page visited, the solution to that would be to include this JavaScript file in the header or any file that is always included before the body of any webpage on the website.
OTHER COMMITMENTS
I am a Fourth year student of the aforementioned institution, I would be writing my project which is a partial fulfillment of the requirement for the award of B.Sc in Statistics.
I am involved in a project which is a suite of software technologies, services and operation targeted at providing students with a medium to simplify their tertiary educational life and activities by providing them with services focused at different aspects of advanced educational technologies.
I also belong to AISEC, Abeokuta which is a Non Governmental Organization aimed at building up young people for leadership roles.