From a99787d9286f51b01826ad4c75d401d79f0e13b8 Mon Sep 17 00:00:00 2001 From: jeena Date: Mon, 13 Sep 2010 22:43:15 -0700 Subject: [PATCH] Migrated from plugins v1 --- Plugins.textile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Plugins.textile diff --git a/Plugins.textile b/Plugins.textile new file mode 100644 index 0000000..e139c11 --- /dev/null +++ b/Plugins.textile @@ -0,0 +1,25 @@ +This is a example plugin to get you started. It removes tweets which contain one of the stopwords. Save the code in a file called Plugin.js @~/Library/Application Support/Twittia/@. You have to create this directory yourself. + + +bc. $(document).ready(function() { + if(twittia_instance.action == "home_timeline") { + twittia_instance.body.addEventListener( 'DOMNodeInserted', filter, false ); + } +}); +function filter(e) { + var stopwords = [ + // Add the stopwords here + "apple", + "#iPhone" + ]; + var element = e.target; + var parent = element.parentNode; + if(parent != twittia_instance.body) return; + var text = element.innerHTML; + for(var i=0, count=stopwords.length; i -1) { + parent.removeChild(element); + return; + } + } +}