diff --git a/4chan_x.user.js b/4chan_x.user.js index 2d9e350c9..7f446d3df 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -151,6 +151,7 @@ email: ['# Filter any e-mails that are not `sage` on /a/ and /jp/:', '#/^(?!sage$)/;boards:a,jp'].join('\n'), subject: ['# Filter Generals on /v/:', '#/general/i;boards:v;op:only'].join('\n'), comment: ['# Filter Stallman copypasta on /g/:', '#/what you\'re refer+ing to as linux/i;boards:g'].join('\n'), + country: [''].join('\n'), filename: [''].join('\n'), dimensions: ['# Highlight potential wallpapers:', '#/1920x1080/;op:yes;highlight;top:no;boards:w,wg'].join('\n'), filesize: [''].join('\n'), @@ -701,6 +702,13 @@ } return text.join(''); }, + country: function(post) { + var flag; + if (flag = $('.countryFlag', post.el)) { + return flag.title.replace('Country: ', ''); + } + return false; + }, filename: function(post) { var file, fileInfo; fileInfo = post.fileInfo; @@ -2322,6 +2330,7 @@ \ \ \ + \ \ \ \ diff --git a/changelog b/changelog index 26ea54032..772521b37 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Add Country filtering. 2.33.7 - Mayhem diff --git a/script.coffee b/script.coffee index 37daa2bc1..9bfabe127 100644 --- a/script.coffee +++ b/script.coffee @@ -86,6 +86,9 @@ Config = '# Filter Stallman copypasta on /g/:' '#/what you\'re refer+ing to as linux/i;boards:g' ].join '\n' + country: [ + '' + ].join '\n' filename: [ '' ].join '\n' @@ -552,6 +555,10 @@ Filter = for i in [0...nodes.snapshotLength] text.push if data = nodes.snapshotItem(i).data then data else '\n' text.join '' + country: (post) -> + if flag = $ '.countryFlag', post.el + return flag.title.replace 'Country: ', '' + false filename: (post) -> {fileInfo} = post if fileInfo and file = $ '.fileText > span', fileInfo @@ -1778,6 +1785,7 @@ Options = +