WordPress.org

Ready to get started?Download WordPress

Forums

FeedPress
[resolved] What triggers Feedpress ping? (5 posts)

  1. marcelbrown
    Member
    Posted 1 year ago #

    I run a blog where I post daily items based on the day in history (http://thisdayintechhistory.com). I like to refresh the posts for each day by updating the posts with the currently year so that the items for that day show up on top, plus the RSS feed is refreshed so that the items are sent out every day (plus posted to Facebook, etc.). I finally figured out a way to automate to process by running a cron job of a mysql command (instead of manually updating each post every day!). However, it seems that my mysql command does not trigger the Feedpress plugin to ping an update. I would like to know if there is a simple way to do this, or to schedule Feedpress to automatically update the feed.

    Here is my mysql command for reference:

    UPDATE wp_posts SET post_date_gmt = concat(UTC_DATE(),' ',time(post_date_gmt)), post_date = concat(CURDATE(),' ',time(post_date)), post_modified = NOW(), post_modified_gmt = UTC_TIMESTAMP() WHERE MONTH( post_date ) = MONTH( CURDATE( ) ) AND DAYOFMONTH( post_date ) = DAYOFMONTH( CURDATE( ) ) AND post_status = 'publish'

    Thanks!

    http://wordpress.org/plugins/feedpress/

  2. marcelbrown
    Member
    Posted 1 year ago #

    Update: I also added this mysql command

    INSERT INTO wp_postmeta (post_id,meta_key,meta_value) SELECT id,'_pingme','1' FROM wp_posts WHERE MONTH( post_date ) = MONTH( CURDATE( ) ) AND DAYOFMONTH( post_date ) = DAYOFMONTH( CURDATE( ) ) AND post_status = 'publish'

    From what I understand, the next time a page is loaded, the rows added by this command which include the _pingme field will trigger a ping. Am I correct?

  3. maximevalette
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Marcel,

    Thanks for your interest in FeedPress!

    If you do raw MySQL requests WordPress can't trigger the events.

    Instead of the MySQL request you may take a look at the wp_update_post function. You can easily update the post date with that.

  4. marcelbrown
    Member
    Posted 1 year ago #

    I figured out a way to do this with a combination of SQL statements and some PHP code. I'll post the details soon. Thanks!

  5. marcelbrown
    Member
    Posted 1 year ago #

    I blogged about this little project here. I mention FeedPress in it extensively.

    http://solotechpros.com/2013/08/02/automate-recycling-wordpress-posts-on-a-yearly-basis/

    I wouldn't mind someone looking over my code and advising me on a better way to do it so I can learn. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.