summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--dislike.css0
-rw-r--r--dislike.js13
-rw-r--r--manifest.json16
4 files changed, 32 insertions, 0 deletions
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
--- /dev/null
+++ b/dislike.css
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/*"
+ ]
+}