WordPress.org

Ready to get started?Download WordPress

Forums

How to fix time of daily digest for twitter tools ? (4 posts)

  1. rk
    Member
    Posted 7 years ago #

    I have these feature requests :
    1. The time of posting the daily digest should be configurable (to take care of different time zone). I tried to change the code but something went wrong. So if you could provide a "option" to choose the timing, taht would be great.
    2. The tweets which start with "@" could be avoided from the daily digest.(Since that will not make much sense on the blog). I tried some code for this, but since the daily update has stopped completely, could not verify.
    I would be glad if someone points out, how to do these

  2. mlanger
    Member
    Posted 6 years ago #

    These are great feature requests. I'd also like to see them implemented in a future version of Twitter Tools.

  3. electricbob
    Member
    Posted 6 years ago #

    Me too - the code has a bug in it in that it assumes Twitter returns the post date in local time, which apparently isn't true, but the database comparison does use local time. It would be nice to get this one fixed as I suspect there may be missing tweets...

    Thanks and have fun! - Bob

  4. electricbob
    Member
    Posted 6 years ago #

    I got an extra day off from work (a four day weekend!) and spent some time working on this bug. I believe I have a patch that fixes the problem; this patch makes sure the date for tweets in the database is timezone-corrected, based on the timezone set in WordPress; it would be better to fix all the comparisons to work with UTC time, but that's much more complicated and this solution is dead simple.

    Here's the patch:

    *** twitter-tools.php.0	Sun Apr 13 20:07:12 2008
    --- twitter-tools.php	Thu Jul  3 13:06:44 2008
    ***************
    *** 401,406 ****
    --- 401,409 ----
    
      	function add() {
      		global $wpdb, $aktt;
    + 		// RLH: The next line corrects Twitter's UTC to WordPress timezone setting
    + 		$this->tw_created_at = $this->tw_created_at + (get_option('gmt_offset') * 3600);
    + 		// RLH: End changes
       		$wpdb->query("
      			INSERT
      			INTO $wpdb->aktt
    ***************
    *** 1353,1358 ****
    --- 1356,1364 ----
      {
    
      	$now = time();
    + 	// RLH: Must shift "now" back to proper timezone to match WordPress
    + 	$now = $now +  + (get_option('gmt_offset') * 3600);
    + 	// RLH: End changes
    
      	$time = gmmktime(
      		substr($date, 11, 2)

    You must apply this patch to the 1.2b1 version of twitter tools.

    Thanks and have fun! - Bob

Topic Closed

This topic has been closed to new replies.

About this Topic