Martin Atkins (mart) wrote in lj_dev,
Martin Atkins
mart
lj_dev

Custom Entry URLs

Ages and ages ago I proposed allowing entries to have custom permalink, talkread and talkpost URLs rather than the system-generated ones. I'll quickly propose it again for the sake of those who weren't paying attention last time:

What?

Support three new logprops which allow a particular entry to link to some offsite URL for one or more of the permalink, talkread or talkpost links. Custom talkread and/or talkpost implicitly disables LiveJournal's local comment system, assuming that you've got your own comment system that you want to link to somewhere else.

Why?

My main motivation for this on this particular occasion is as the first part of some changes to make the syndication feed accounts “fit in” a bit more nicely. Though I'm going to propose/discuss this separately later, I'm intending eventually to make synsuck set these custom props if appropriate for each entry, as well as augmenting the Atom/RSS feeds that LJ itself generates to include talkread and talkpost URLs so that feeds from other LiveJournal-based sites will come across more naturally. However, this is also useful for people who have an off-site blog from which they push copies of entries onto LiveJournal. I only know two people who do this, but I assume there must be more.

How?

Three new logprops are provided, called url_permalink, url_talkread and url_talkpost. Each of these, when present, replaces the system-generated URL in most places. To allow for the places where this isn't supported directly, talkread.bml presents something sensible so that there is actually something at the canonical entry URL. Journal views link directly to the destination entry, of course.

I've already implemented the guts of this on my local dev site. My local dev site isn't publically accessible, so here are some screenshots:

The first screenshot shows talkread.bml with all three props set: the comments area is replaced with links to the relevant URLs, and a link to the permalink URL is provided. The second screenshot shows how an S2 style responds: the Read Comments link doesn't include a number because the comments are offsite and thus we have no count to show. Perhaps later if we're feeling crazy we could provide a simple API to let the remote site set a comment count, but I think this will do for now.

So?

There are a few issues left unresolved. The first is what to do about our old friend S1. I could add to it a new variable for just “Read Comments” rather than including the current count, but of course all of the existing styles won't support it so a back-compat shim is necessary. The best thing I can think of is to pass some silly string in to the comment count variable, so it'll show something like “? comments”. A bit quirky, but at least people can fix it if it bothers them. Any better ideas are welcome.

The other issue is whether this can be abused. One attack I can think of is someone writing a very hateful entry and setting the talkpost URL to be someone else's entry, thus causing unattentive users to post any replies there. It may be possible to just disallow URLs to the local site, but that stops people using this as a quick hack to do community cross-posting while collecting all of the comments in one place. That might not even be a great idea in the first place. So should this be locked down so that only syndication accounts can do it?

Any other thoughts/opinions are obviously welcome as well.

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 16 comments