random: (Default)
Random ([personal profile] random) wrote in [site community profile] dw_dev2009-05-26 03:30 pm

Twitter / Dreamwidth Interaction

So, like many people, I have both a Twitter and DW account, and I've been trying to figure out how to integrate them intelligently, since I find the automated Twitter daily posts incredibly annoying in other people's journal.

So, one thing that I was playing with was seeing if DW's styling code would allow me to embed the Twitter embedded feeds And the answer seems to be clearly that no, you can't embed it - I tried both putting it in Transmogrified as custom text, and putting it in a custom S1 style as a hard-code print command right after the sidebar was drawn, and both had the scripts stripped. That seems to be the case whether you use the Flash object or the JavaScript HTML embed version. (As an aside, since people load other people's pages in their own styles sometimes, I think it's the right call for the JS - I'm a little more surprised about the Flash, but I assume that it's to prevent embedded advertising by adver-bots.)

But I'm wondering if the S2 modules could give an option of actually creating a Twitter module, that would simply take as a username as an option (presumably in Text / Options in the "Customize Styles"), and then display the badge controlling the code that's used, so there's no risk of problems with XSS or adver-bots? Would there be interest from the development team in this? If so, is there anyone who is interested in doing this, since I've got way more experience in PHP and Java development than Perl? If there's interest in the feature but no one wants to jump on it, would someone who has been working on the DW codebase be willing to give me some pointers and do a code review for me?
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)

[personal profile] matgb 2009-05-27 05:39 pm (UTC)(link)
Simple. Add a line of CSS to your Custom CSS:
.loudtwitter { display:none!important}

Job done. I've stopped displaying my tweets, but at some point I'll set up a custom filter for them as some people like them to be there.

Some like it a lot, some dislike it a lot, and people like to do what they like with their blog. If you don't like their blog, then not reading it is easy.
unixronin: A mon made from four torii gates (Wisdom/Zen)

[personal profile] unixronin 2009-05-27 06:22 pm (UTC)(link)
That does part of the job, but leaves the page cluttered with empty posts. I did that to start with, but ended up modified my LJ style to detect posts containing twitter content and skip displaying them altogether.

Possibly I find it more annoying than others do. Or maybe I'm just a perfectionist about things. But then, frankly I don't "get" Twitter in the first place.
the_lighthouse: (Newtons cradle)

Help a fellow curmudgeon?

[personal profile] the_lighthouse 2011-03-25 03:49 pm (UTC)(link)
I know you posted this like two years ago, but I was searching google for some way to block twitter feeds from showing up in DW and it brought me to this thread. You mentioned that you modified your style to detect posts containing twitter content and not display them, I was wondering if you could share with me how you go about doing that? I can't stand Twitter feeds! If I wanted to see them, I'd subscribe to Twitter. Any help would be appreciated.
cesy: "Cesy" - An old-fashioned quill and ink (Default)

Re: Help a fellow curmudgeon?

[personal profile] cesy 2011-03-25 03:53 pm (UTC)(link)
Matgb has a post on how to do this for people using LoudTwitter.

Edit: Ah, Matgb explained that further up, sorry.
Edited 2011-03-25 15:53 (UTC)
unixronin: Galen the technomage, from Babylon 5: Crusade (Default)

Re: Help a fellow curmudgeon?

[personal profile] unixronin 2011-03-25 04:08 pm (UTC)(link)
Well, it's specific to the style, and I did it on LiveJournal not on Dreamwidth. But the key snippet of code was this:

function FriendsPage::print_body ()
{
    foreach var Entry e ($.entries) {
      if (($e.text->contains("Automatically shipped by <a href=") and $e.text->contains(">LoudTwitter</a>"))
           or $e.text->contains(">Daily Tweets</a>")) {
            # skip tweets
        } else {
           .....
Edited (Forgot to escape &gt;&lt; ...) 2011-03-25 16:11 (UTC)
the_lighthouse: (Default)

Re: Help a fellow curmudgeon?

[personal profile] the_lighthouse 2011-03-25 04:28 pm (UTC)(link)
Thanks so much, at least it gives me something to try/starting point!