We’d like to have an RSS feed that always contains our blog posts except those posted in the last 12 hours. We’d use it for our NewsTex syndication to Lexis-Nexis, so that we’d have several hours to correct errors and provide updates, before our posts are permanently archived there. Is there an easy way of doing that? I’d much appreciate your suggestions. Many thanks!

Categories: Uncategorized    

    17 Comments

    1. Chipsa says:

      Yahoo pipes should allow you to easily filter out recently published entries.

    2. DiversityHire says:

      You’re using wordpress, right? Here’s an example of a 5-minute publication delay. There’s also filters if you want to dig around.

    3. Ben says:

      Chipsa’s suggestion of Yahoo Pipes seemed to work.

      I connected a “Fetch Feed” object set to http://volokh.com/feed/ to a “Filter” object set to block any entries that didn’t match the rule, with a rule of “item.pubDate is after …” with the actual date field connected to a “Date Builder” defined as “12 hours ago” — finally I connected the Filter to the Pipe Output and it screened out this entry, the one posted at 1:21am, the two posted at 12:21am, and the one posted at 5:56pm. The first that shows is the one on soccer at 11:33am.

      Never used it before but it seems to be working? Keep in mind it’s in beta.

    4. JSL says:

      Well a rss feed is a pretty simple retrieval of data from a database – the simplest solution for what you want to do is just to make a copy of your existing feed, and then modify the query that retrieves the blog posts from the database. Assuming this site uses a MySql DB, and the blog posts are stored with a timestamp then find the query that retrieves in the existing feed code and add one line…
      the query looks like this..

      SELECT whatever
      FROM yourtable
      WHERE whatever
      ORDER BY whatever
      limit 0,whatever

      you need to add something like this…

      AND DATE_SUB(CURDATE(),INTERVAL 12 hour) >= yourtable.timestampfield

      so the new query will look like…

      SELECT whatever
      FROM yourtable
      WHERE whatever
      AND DATE_SUB(CURDATE(),INTERVAL 12 hour) >= yourtable.timestampfield
      ORDER BY whatever
      limit 0,whatever

      timestampfield – is whatever the name of the field in your table that stores the timestamp for each blog post.

    5. Lior says:

      Off-topic:

      Could you add an RSS feed for the comment thread attached to each post? This would be much better than then “Notify me of followup comments via e-mail” button.

    6. Question says:

      How do you block out posts from certain authors? That was possible before the switch was made. Those of us who prefer not to read the latest musings of David Bernstein, Jim Lindgren, or Ken Anderson would be greatly appreciative.

    7. anonymous says:

      I much hope you have success in your quest!

    8. Northern Dave says:

      I like Ken Anderson’s musings! (David and Jim’s are OK, too).

    9. Shane says:

      I second DiversityHire’s recommendation. Relying on Yahoo! Pipes is relying on Yahoo! to keep the service up and running – why use the cloud when you don’t have to? And the SQL stuff seems to get unnecessarily deep into the nuts and bolts the website. Doing things at the WordPress layer seems like the best bet, even if that particular “Publish the Feed Later” script doesn’t work for you.

      Don’t know much about WordPress, but this would be a really easy script to write for a Django site without any SQL. I’d expect that to be true of a platform as mature and as widely used as WordPress.

    10. Shane says:

      While we’re talking about the website, I’d like to request that paragraphs in the comments not be indented. I find that to be visually jarring, and I don’t think it’s common practice on blogs. The above SQL queries look especially funny from the first line indent.

    11. JSL says:

      Shane: And the SQL stuff seems to get unnecessarily deep into the nuts and bolts the website.

      It does get into the nuts and bolts, but it’s also the easiest way. open a file, save as something else, add one line of code, bam you are done. Less than 5 minutes, you have a new feed with a 12 hr. delay.

      Any other method you use is a more complicated and contrived way of doing exactly the same thing. There is no need to know how to write a script, or rely on third party gadgets like yahoo or word press, etc. All you have to so is take one of the simplest scripts on this site – the one that produces http://volokh.com/feed/ – and modify it by adding one line, save as … done.

    12. Shane says:

      JSL – The script that produces the http://volokh.com/feed/ uses SQL somewhere, sure, but it’s probably so far abstracted by the WordPress framework that it’s unnecessarily complicated (and potentially unreliable/insecure) for a normal WordPress site administrator to mess with. Given that they’re using WordPress here, and that Prof. Volokh probably did not have to manually run a single SQL query in setting up this site – asking him to use a custom SQL query, no matter how simple, will probably be a more complex task for him than just copying and pasting the above-linked 5-minute script and substituting values (12 for 5, hours for minutes) into a custom WP plugin.

    13. Craig says:

      I will offer another vote in favor of using DiversityHire’s suggestion to use the WordPress capabilities. It will require a tiny amount of packaging (to make it look like a WordPress plugin) but then you can turn it on and off within the WordPress administrative framework. The end result should look something like this:

      <?php
      /*
      Plugin Name: Delay RSS Feed
      Description: Delays the RSS Feed updates by 12 hours.
      Version: 1.0
      */

      function publish_later_on_feed($where) {
      global $wpdb;

      if ( is_feed() ) {
      // timestamp in WP-format
      $now = gmdate(‘Y-m-d H:i:s’);

      // value for wait; + device
      $wait = ’12′; // A number
      $unit = ‘HOUR’; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

      // add SQL-sytax to default $where
      $where .= ” AND TIMESTAMPDIFF($unit, $wpdb->posts.post_date_gmt, ‘$now’) > $wait “;
      }

      return $where;
      }

      add_filter(‘posts_where’, ‘publish_later_on_feed’);
      ?>

      Just copy the code into a new file in your wp-content/plugins directory (say ‘delay-rss-feed-plugin.php’), then go into the WordPress admin pages to activate it.

    14. FantasiaWHT says:

      Only marginally related, but can somebody tell me how to set it up that I get each new blog post emailed to me right when it’s posted like I used to?

    15. anomdebus says:

      While we are asking random site questions.. Anyone know how to get my WordPress login recognized by Volokh?

    16. Myrtle Beach Attorney says:

      If you would like to find information about Colorado Springs Real Estate, visit the Real Estate Book, the web

    17. Brett Mackimmie says:

      finally discovered somewhere with some useful details. thanks and keep it coming :)