Skip to content

Instantly share code, notes, and snippets.

View catrope's full-sized avatar

Roan Kattouw catrope

  • Wikimedia Foundation
  • San Francisco, CA
View GitHub Profile
Echo
188e8d7 No-JS special page: One-click mark as read
f751e96 Unread pages API
0706567 Adjust styling for Special:Notification items
acc672c Darken the dates in the Special:Notifications groups
6e21a62 Clean up the pagination in Special:Notifications
cf99479 Display a message if there are no notifications in Special:Notifications
6ad1abc Cleanup DiscussionParser
f88c90e Fix notification pager
b3d1689 Maintenance: Backfill read timestamp on bundled notifications
$.ajax( {
// Get this URL
url: '/api/rest_v1/page/html/' + mw.config.get( 'wgPageName' ),
// Interpret the result as HTML (as opposed to XML or JSON or something)
dataType: 'html'
} )
.done( function( html ) {
// Parse the result as HTML
var doc = new DOMParser().parseFromString( html, 'text/html' ),
// You can now use jQuery to find stuff using $( 'selector', doc )
@catrope
catrope / gist:6367c64591bd9d39b9dc591ebf2c3e12
Created May 12, 2016 05:05
Cross-wiki notification beta feature usage as of 2016-05-12 05:00 UTC
TOTAL: 22,183 accounts across 415 wikis
7772 enwiki
1226 ruwiki
1203 frwiki
1154 eswiki
1045 dewiki
931 commonswiki
769 zhwiki
586 arwiki
@catrope
catrope / gist:d2874b18ce249cd2779a084f59f766c8
Created April 28, 2016 03:35
Cross-wiki notification beta feature usage as of 2016-04-28 03:30 UTC
Total: 18084 across 369 wikis
6255 enwiki
1065 frwiki
1002 ruwiki
914 eswiki
887 dewiki
793 commonswiki
618 zhwiki
465 arwiki
Echo
a9c6515 Fix regression from 0fc63bde365: unbreak number formatting in short timestamps
f3ce2de Add tooltips for 'mark as read' and 'more options'
bb1192a Increase line-height for survey to 16px
f9d2aac Browser tests: fix nojs tests
b913601 Use plaintextParams() for snippets and sections
62216ca Display only one foreign bundle on mobile
2851419 Bold 'talk page' in edit-user-talk bundled notification
6c49d3e Update OOUI hacks for I8987dade5ed
c9332d8 Apply momentjs hack for short relative times on mobile too
Echo
a9c6515 Fix regression from 0fc63bde365: unbreak number formatting in short timestamps
Flow
b0a775e Use topic-of-post-text-from-html for all UI purposes, never use topic-of-post
19202d3 Use plaintext for topic titles in resolved notification
3097ea3 Fix sink-handling
7846c6a Remove revision range
4f7e0b4 Mark rev_content_model as code per request
Echo
bdb50c7 Update notifications when reopening the popup
a4ea2de FooterNoticeWidget: Set image height explicitly
732c849 Also show the survey tooltip on click
f35251f Never show a negative number in the notifications badge
Flow
c2c86e5 Flow dumps XSD schema
7854141 Show cursor:pointer on things that toggle expand/collapse of resolved topics
c84f438 Fix new topic notifications
@catrope
catrope / cross-wiki-results.txt
Last active March 23, 2016 19:47
Cross-wiki notifications data 2016-03-23
# NOTE: Notifications counts are capped at 100 per user per wiki per type (alerts vs messages).
# This means that a user who has 800 alerts on enwiki will be counted as having 100 notifications,
# but a user who has 400 alerts and 400 messages on enwiki will be counted as having 200 notifications,
# and a user who has 400 alerts on enwiki and 400 alerts on commonswiki will also be counted as having 200 notifications.
# Histogram of number of wikis that users have unread notifications on
SELECT numwikis, COUNT(*) AS numusers FROM (SELECT euw_user, COUNT(*) AS numwikis FROM echo_unread_wikis WHERE euw_alerts>0 OR euw_messages > 0 GROUP BY euw_user) AS t GROUP BY numwikis;
+----------+----------+
| numwikis | numusers |
@catrope
catrope / gist:0302a3c346571d4edd01
Created January 22, 2016 20:36
Cross-wiki notifs data, round 2
# Histogram of number of wikis that users have unread notifications on
mysql:research@x1-analytics-slave [wikishared]> SELECT numwikis, COUNT(*) AS numusers FROM (SELECT euw_user, COUNT(*) AS numwikis FROM echo_unread_wikis GROUP BY euw_user) AS t GROUP BY numwikis;
+----------+----------+
| numwikis | numusers |
+----------+----------+
| 1 | 31115 |
| 2 | 1832 |
| 3 | 1094 |
| 4 | 496 |
| 5 | 48 |
@catrope
catrope / gist:80ffb8f02d1ce7deb303
Created January 22, 2016 00:39
Cross-wiki notifs data
# Queries run around 4:30pm PST on 2016-01-21
# Histogram of how many wikis users have unread notifications on
# (21k users have unread notifs on 1 wiki, 1174 on 2 wikis, 949 on 3 wikis, etc)
mysql:research@x1-analytics-slave [wikishared]> SELECT numwikis, COUNT(*) AS numusers FROM (SELECT euw_user, COUNT(*) AS numwikis FROM echo_unread_wikis GROUP BY euw_user) AS t GROUP BY numwikis;
+----------+----------+
| numwikis | numusers |
+----------+----------+
| 1 | 21177 |
| 2 | 1174 |