egypturnash: (Default)
[personal profile] egypturnash
Huzzah! Now every post that contains "Automatically shipped by Loudtwitter" will be filtered out of my friendslist. It's not like I don't want to hear what you have to say; I just don't want to see a record of half of the conversations you had via Twitter with people I've never met, or hear that the office bathroom is out of toilet paper.

Date: 2009-02-09 03:29 pm (UTC)
From: [identity profile] inaki.livejournal.com
I request this code!

Date: 2009-02-09 03:52 pm (UTC)
ext_646: (Default)
From: [identity profile] shatterstripes.livejournal.com
You need to have your own custom style to actually do this, sadly; otherwise you're stuck trying to convince said friend that their twittering should stay on Twitter, or dropping them from your default view.

This snippet assumes that the post object is in a variable called 'e', and lives at the top of the function that prints a post.

# abort entire function if this is just a twitspam post
if (($e.text->contains("Automatically shipped by")) and ($e.text->contains ("LoudTwitter")) ) {
return;
}

Date: 2009-02-09 10:35 pm (UTC)
From: [identity profile] cobaltie.livejournal.com
I wish there was a way on the other end to change the settings, so that I could filter an opt-in list for anyone curious about the Twitter stuff. I could set up custom friends-groups, but LoudTwitter in particular doesn't have an option to publish to that specific group only. It's...loud, in that sense.

Date: 2009-02-09 10:02 pm (UTC)
From: [identity profile] eriscontrol.livejournal.com
Here is a dirty, nasty, disgusting Grease(Kit|Monkey) hack that seems to work for me. You will need to change it to suit other layouts unless they all wrap posts in <favorite_tag class="box">…</favorite_tag>. I don't know if you're a coder at all or not, so if you'd like me to modify it for your layout, just ask. :)

// ==UserScript==
// @name          LoudTwitter Killer
// @namespace     net.isotania.js.LoudTwitterKiller
// @description   This script fucks LoudTwitter's shit.
// @include       http://*.livejournal.com/
// @include       http://*.livejournal.com/friends
// @include       http://*.livejournal.com/friends/*
// ==/UserScript==

(function() {
	function container_finder(node) {
		var nodeClass = node.getAttribute('class');
		if (nodeClass)
			return null != nodeClass.match(/\bbox\b/);
		else
			return false;
	}

	function matching_ancestor(node, matcher) {
		if (node == document.body)
			throw new Error("Whoops, I couldn't find the post");
		else if (matcher(node.parentNode))
			return node.parentNode;
		else
			return arguments.callee(node.parentNode, matcher);
	}

	var anchors = document.evaluate('//a[@href="http://www.loudtwitter.com"]', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
	var anchor;
	while (anchor = anchors.iterateNext()) try {
		var post = matching_ancestor(anchor, container_finder);
		post.parentNode.removeChild(post);
	}
	catch (error) {
		console.log(error)
	}
})()

Date: 2009-02-09 10:06 pm (UTC)
From: [identity profile] eriscontrol.livejournal.com
Also, in practice, this removes any entries that contain links to "http://www.loudtwitter.com" exactly, but I doubt I care to read any post that does whether it's twitter copypasta or not. I tried finding the post by //ul[@class="loudtwitter" but if the entry is behind a cut then that falls down.

Date: 2009-02-09 11:23 pm (UTC)
From: [identity profile] strredwolf.livejournal.com
But but... [livejournal.com profile] triggur was just in there and...

Eh. I can't blame you.

Profile

egypturnash: (Default)
Margaret Trauth

October 2020

S M T W T F S
    123
45678 910
11121314151617
18192021222324
25262728293031

Most Popular Tags

Expand Cut Tags

No cut tags
Page generated Jun. 23rd, 2025 04:32 am