WordPress.org

Ready to get started?Download WordPress

Forums

Postie
Postie For "Live" Blogging (3 posts)

  1. bradsalomons
    Member
    Posted 8 months ago #

    I don't intend this as self-promotion. I've been trolling through the answers on this forum for the last week trying to figure out the awesome extending functionality via the filterPostie.php file and was able to do something pretty cool that I wanted to share back to the support thread (and get feedback for any potential improvement, as there are folks who know this stuff better than I do).

    Having looked, I know the options for live blogging with wordpress are few and far between. But I have successfully tweaked Postie to add a simple but basic email-based live blogging functionality through the filterPostie extension (and some basic wordpress customization.) The detailed explanation (and sample code) is on my blog at http://blog.8r4d.com/2014/06/16/thinking-about-live-blogging but the short explanation is essentially:

    1) create a "live" post with a known ID
    2) email the Postie plugin with a subject that has that "live" ID in it somewhere
    3) use some of the postie extension functionality to (a) concatenate the contents of that new Postie-generated post (plus some time stamp info) to the top of "live" post and (b) set that new post to 'trash'
    4) rinse and repeat

    Hopefully this is useful to someone.

    https://wordpress.org/plugins/postie/

  2. bradsalomons
    Member
    Posted 8 months ago #

    For continuity of the thread, here is the code. I'm using the post-format type 'video' for my "live blog" type --only because I was using everything else for something else already. I don't know if you need to do this, but it's how I did it.

    Email This:
    
    Subject: video//12345
    Body: Lorum Ipsum #img1# Content, Content, Content!
    
    -------------
    
    function check_live_blog($post) {
    
    $format = get_post_format( $post['ID'] );
    
    if ($format == 'video'){
    $live_id = $post['post_title'];
    $original_post_content = get_post_field('post_content', $live_id );
    $updated_live = "<BR/><strong>".$post['post_date']."</strong><BR/><BR/>".$post['post_content']."<BR/>".$original_post_content;
    $live_post = array('ID' => $live_id, 'post_content' => $updated_live);
    wp_update_post( $live_post );
    $email_post = array('ID' => $post['ID'], 'post_status' => 'trash');
    wp_update_post( $email_post );
    }
    
    return $post;
    }
    
    add_filter('postie_post_after', 'check_live_blog');
  3. Wayne Allen
    Member
    Plugin Author

    Posted 8 months ago #

    Cool idea, thanks for sharing!

Reply

You must log in to post.

About this Plugin

About this Topic