From e37826e39ec23828a6be0401f0a3edea73fea2b5 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Sun, 26 Aug 2018 00:31:59 +0300 Subject: Initial commit --- README.md | 3 +++ dislike.css | 0 dislike.js | 13 +++++++++++++ manifest.json | 16 ++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 README.md create mode 100644 dislike.css create mode 100644 dislike.js create mode 100644 manifest.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..2298527 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Dislike + +A browser extensions that cleans up the mess that Twitter creates in your feed diff --git a/dislike.css b/dislike.css new file mode 100644 index 0000000..e69de29 diff --git a/dislike.js b/dislike.js new file mode 100644 index 0000000..c31b9ee --- /dev/null +++ b/dislike.js @@ -0,0 +1,13 @@ +function remove_liked_tweets() { + document.querySelectorAll('div.tweet-context').forEach(function (el) { + if (el.innerText.endsWith('others liked')) { + var tweet = el.parentNode.parentNode; + var button = tweet.querySelector('button[data-feedback-type="DontLike"]'); + button.click(); + var permalink = tweet.getAttribute('data-permalink-path'); + console.log('Removed liked tweet ' + permalink); + } + }); +} + +setInterval(remove_liked_tweets, 5000); diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..957fd82 --- /dev/null +++ b/manifest.json @@ -0,0 +1,16 @@ +{ + "name": "Dislike", + "version": "0.1.0", + "manifest_version": 2, + "description": "A browser extensions that cleans up the mess that Twitter creates in your feed", + "homepage_url": "https://github.com/yuvadm/dislike", + "content_scripts": [{ + "matches": [ + "https://twitter.com/*" + ], + "js": ["dislike.js"] + }], + "permissions": [ + "https://twitter.com/*" + ] +} -- cgit v1.3.1