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?
liv: Stylised sheep with blue, purple, pink horizontal stripes, and teacup brand, dreams of Dreamwidth (sheeeep)

[personal profile] liv 2009-05-26 08:15 pm (UTC)(link)
I would dearly love to be able to put a Twitter module in S2! A friend wrote a hack for me to do it on LJ, which involves (I think) using php to dynamically generate a custom CSS file with Twitter updates in an "before" element. But that's clearly not the right way to do it, it just gets round the restrictions that LJ and DW have on including any kind of scripting in journal layouts.
unixronin: Rodin's Thinker (Thinker)

[personal profile] unixronin 2009-05-26 09:32 pm (UTC)(link)
Honestly, what I'd really prefer (and implemented in my style on LJ) is an option to simply never ever see Twitter posts, PERIOD. Call me a curmudgeon if you will, but if I wanted to read people's usually-almost-or-completely-context-free "tweets", I'd go join Twitter. I don't quite understand why the Twitter crowd don't get this.
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!
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2009-05-26 10:15 pm (UTC)(link)
Short message, in car--

Yes an S2 module sounds appropriate for this sort of thing, and I have nothing against the idea. Would have to see exactly what this module does. Shows you your friends tweets I assume?
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)

[personal profile] matgb 2009-05-27 05:41 pm (UTC)(link)
I use Twitterfeed to send my posts to Twitter, nice and easy. I find it more reliable than Twitter Tools, which is the WP plugin, although I'm told that's stopped not working in a recent update.
mundens: Picture of Brad Pitt playing Tyler  Durden from Fight Club. My Hero (Default)

[personal profile] mundens 2009-05-26 10:36 pm (UTC)(link)
Assuming what you mean by this is something that could sit in the sidebar and display ur latest twats, so u don't have to post them as entries in the journal?

If so, I'd agree that would be a great idea! Other blogs (wordpress, 4x) already have such widgets available.

Not sure I can help, I'm a web-app developer for a big corp, so we don't use hacky things like Perl *grin*, but I'm pretty good on the underlying tech, CSS, XML etc.
msilverstar: (corset)

[personal profile] msilverstar 2009-05-27 04:14 am (UTC)(link)
unobtrusive twitter would be great. If you're fetching the tweets anyway, be nice to have a dynamic expand when the cursor pauses over the link...
ree: photo of a woman with long blonde hair and glasses (blonde)

[personal profile] ree 2009-05-27 06:58 am (UTC)(link)
It sounds like you're looking for a more thorough integration than TwitStamp provides, but I figured I'd throw it out there anyway. The nice thing about TwitStamp is that it works pretty much anywhere, including DW.
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)

[personal profile] matgb 2009-05-27 05:45 pm (UTC)(link)
The ideal way of getting this isn't to grab stuff just from Twitter. It's to have a way of including RSS feeds (with options) as sidebar modules.

I'd like to have my most recent Tweets and my most recent posts on other blogs displaying (in seperate modules)—if we can figure out a way of having an S2 layer that parses feeds well that'd be really cool and would provide you with your solution as well as being more flexible.

But yeah, no chance of getting a flash or JS embed to work here, and I think that's a policy that should stay.
unixronin: Closed double loop of rotating gears (Gearhead)

[personal profile] unixronin 2009-05-27 06:27 pm (UTC)(link)
The ideal way of getting this isn't to grab stuff just from Twitter. It's to have a way of including RSS feeds (with options) as sidebar modules.
+1. That would be a very nice ability to have. Some kind of an RSS-tracker object that could even appear multiple times in the sidebar, tracking multiple feeds.
ursamajor: Tajel on geeks (geeks: love them)

Including RSS feeds as sidebar modules

[personal profile] ursamajor 2009-05-28 03:04 am (UTC)(link)
I would love this implementation, but wonder about potential copyright violations if one decides to embed content that isn't theirs. One way I could see to alleviate this might be to only allow feeds you've already "claimed" as yours in your profile - like how you can already include your twitter and delicious and other such social networking info in specific fields there. Similarly, for nonSN websites such as a personaltop level domain, you could include it as a module as long as you'd already claimed it in your profile.
matgb: Artwork of 19th century upper class anarchist, text: MatGB (Default)

Re: Including RSS feeds as sidebar modules

[personal profile] matgb 2009-05-28 10:15 am (UTC)(link)
There's no greater copyright issue than someone embedding a youtube or copying an article. RSS feeds are there to promote content and get people to visit, if someone uses a feed they don't own, they're promoting that site.

The BBC actively encourages people to embed their feeds.

I'd have a problem claiming/proving all my sites are mine, I'd put my author feed up for the blogs I write for, they're owned by others. I'd probably even want to combine some of them using something like Pipes, and there's no way that could be claimed in any way; some of my sites would need to be piped or fed through Feedburner first anyway.
miss_s_b: DreamSheep/Matrix icon (Blogging: DreamSheep: Matrix)

[personal profile] miss_s_b 2013-04-05 10:24 am (UTC)(link)
Yeah, I'd still like to see this, four years on.
natf: (Default)

[personal profile] natf 2009-06-01 12:00 am (UTC)(link)
Oooo let me know if this gets done!
gushi: (anthrocon badge)

Hello from the future.

[personal profile] gushi 2021-08-16 02:36 am (UTC)(link)
I came across this on a search while trying to get back in to writing long-form, and was pretty prolific back in the LJ days.

My goal is pretty specific: Many of my friends use twitter. I'd like to, upon posting a new DW entry, update a twitter with a link to the post. The subject, and perhaps some key as to the length. If the post is so short as to fit into a tweet, then just print it as a tweet as well, but I want the DW blog to be the "primary source".

Effectively, twitter would be what RSS was back when people respected open standards.

Yes, this might only work for "public" posts. Maybe friends posts where I can post the subject only.

Now, as I'm also working on my own perl-based client (from the command line) I can just wrap that functionality there, and do it just-for-me. But I'd like to know what others have done for this.
Edited 2021-08-16 02:40 (UTC)