1. 2011
    Nov
    24

    Syndication feeds from templates

    One of the must-have necessities for any blogging or other web publishing software is the RSS (Really Simple Syndication) feed. RSS, or its younger and sexier sibling Atom, is the file format used by news aggregators, which give you a frequent listing of posts and stories published by your favorite blogs, newspapers, journals, whatever you want, without you having to actually go to their website. Usually the RSS feed is generated by some library of code where you construct your feed as an array of objects or data structures. Here's how you put together an RSS feed with PyRSS2Gen, for instance:

    rss = PyRSS2Gen.RSS2(
        title = "Andrew's PyRSS2Gen feed",
        link = "http://www.dalkescientific.com/Python/PyRSS2Gen.html",
        description = "The latest news about PyRSS2Gen, a Python library for generating RSS2 feeds",
    
        lastBuildDate = datetime.datetime.now(),
    
        items = [
           PyRSS2Gen.RSSItem(
             title = "PyRSS2Gen-0.0 released",
             link = "http://www.dalkescientific.com/news/030906-PyRSS2Gen.html",
             description = "Dalke Scientific today announced PyRSS2Gen-0.0, a library for generating RSS feeds for Python.  ",
             guid = PyRSS2Gen.Guid("http://www.dalkescientific.com/news/030906-PyRSS2Gen.html"),
             pubDate = datetime.datetime(2003, 9, 6, 21, 31)),
           PyRSS2Gen.RSSItem(
             title = "Thoughts on RSS feeds for bioinformatics",
             link = "http://www.dalkescientific.com/writings/diary/archive/2003/09 …
  2. 2010
    Mar
    10

    Catching spam comments

    Here’s something worth sharing: I get a lot of comments on this blog. Well, not a lot really, but probably on the order of a hundred every week or so. All of them are spam. And they all have one really obvious thing in common: they’re all written in HTML. So they all start with <p>, which makes them really easy to identify. Now there’s something to put in my spam filter, whenever I get around to making a decent one.

    EDIT: now silly me… it’s my comment posting/formatting code that adds in the <p>, not the spambots. So that tactic goes out the window. But I’m still pretty sure I’ve never actually gotten a legitimate comment. (If you know otherwise… leave a comment? ;-)

  3. 2009
    Oct
    21

    What happened to the trackback spam?

    In the current implementation of my blog software, when someone sends a trackback request, there’s no check to make sure that the remote page actually links to this site. So as you might imagine, I get quite a bit of trackback spam — bogus trackback requests that specify URLs for drug sites, porn sites, etc. It used to be something on the order of 20-30 per day, whereas by contrast, I’d only get one comment (spam of course) every few days. But when I just went to clear out the spam from my database, I saw about 40 spam comments compared to only 2 spam trackbacks. So I have to wonder, are spammers finding comments more profitable than trackbacks? Are they wising up to the fact that comments appear on this site automatically whereas trackbacks don’t? (Doubtful, since my site isn’t really worth that kind of attention)

  4. 2009
    Jul
    29

    Anonymous comments are here!!

    My little post about how much data weighs has been getting a lot of attention ever since I posted it in a Slashdot comment. Well, not really a lot of attention, but it’s gotten over 100 hits this month, which puts it up in the top 5 pages on the site. In the course of investigating where all this traffic is coming from, I noticed a lot of requests in the logs for /blog/addcomment. Now, perhaps a lot of those are spam, but I figured I’ve held off on anonymous commenting long enough. Since there’s no way I’ll be able to do it properly anytime soon, I put in a bit of a hack that lets people post comments without authentication. This probably means I’ll have to go through the comment table to weed out spam posts, but whatever, at least it should be interesting…

  5. 2009
    May
    08

    RSS yay?

    I’ve been working on this for a while now, and finally my blog has a functional RSS feed. It’s the super-ghetto RSS2 format, rather than the newer, slicker (and more complex) Atom, though, so nice things like, I don’t know, HTML(!!) are a no-go, and it’s not even W3C standard compliant, but it works with my RSS reader which is good enough to start with. Use at your own risk.

    And not to worry, someday I’ll do this properly and set up an Atom feed.

  6. 2008
    Oct
    02

    not another blog...

    Blogs are everywhere these days. It seems like they're slowly - and by slowly I mean quickly - infesting every last corner of the internet. So why are blogs so popular? (And how many corners does the internet have, anyway? What would you call that shape?) I'm sure there are about a zillion answers out there if you cared to look, speculated into existence by people who make it their business to come up with random speculation and get you to believe it. Mostly bloggers (look, now I'm blogging about blogs about blogs! It's (meta)2!)

    I'm now going to inform you why blogs are so popular by ignoring all that random speculation and coming up with my own random speculation. This is precisely what happens with blogging: everybody writes, nobody reads. Blogging allows a person with nothing more than a computer and an opinion (sometimes optional) to spout rhetoric for the world to hear, while remaining completely insulated from the fact that in all probability, nobody cares. It's like the law of supply and demand: with such a glut of communication, the vast majority of blogs become pretty much valueless to all except the people writing them. So actually, most blogs …