We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19298
    • 76 Posts
    MichaelHarringtonDesigns Reply #1, 15 years, 9 months ago
    Hello everyone

    I have followed the instructions from this link

    http://rtfm.modx.com/display/ADDON/getFeed

    My twitter feed works, it looks like this..

    MHD_UK: Big Facebook
    Advertiser Dupes Users
    Into Switching to Bing
    http://tiny.cc/ok26n
    41 years, 1 month ago via web

    The problem I have is the bottom line "41 years, 1 month ago via web" this is completely wrong does anyone know a way to make sure the correct date is shown?
      • 18913
      • 654 Posts
      Off the top of my head, I’d say that date corresponds to 1/1/1970. So my hunch would be that some date field/variable is coming back with a value of 0 and being converted into a date ... 1/1/1970. So I doubt you have a formatting problem...
      Matt
        • 35527
        • 11 Posts
        I noticed that and created a fix for it. Basically, create a snippet (I called mine tweettime) that has the following code in it:
        <?php
        $time = date('Y-m-d H:i:s O', $time);
        return $time;
        ?>


        Then replace the timestamp code in your tweet chunk with the following:
        [[!tweettime:ago? &time=`[[+date_timestamp]]`]]


        That should fix you right up.

        Basically, the problem is that the :ago filter in MODx looks for a String time and the Twitter RSS provides a Unix timestamp. By filtering the Twitter timestamp through the above snippet, you convert it to a String time which MODx can use to work out how long ago it actually was.

        Hope that helps. I thought I’d share the fix in case no one else had worked it out.
          - moltis
          • 14730
          • 34 Posts
          I encountered the same problem. Thanks for providing the cause!

          There’s an output modifier that does the same thing as your snippet:

          Instead of
          [[+date_timestamp:ago]]
          use
          [[+date_timestamp:date:ago]]


          Happy tweeting!

          btw, officially twitter doesn’t support rss anymore
            • 35527
            • 11 Posts
            I seem to remember trying :date:ago and it didn’t work for some reason.
              - moltis
              • 14730
              • 34 Posts
              hmmm.. strange. It did work for me.
              modx motto: there are more ways to solve a single problem!
                • 36607 ☆ A M B ☆
                • 44 Posts
                Instead of:

                [[+date:ago]]


                I use this in my chunk and it works for me:

                [[+date_timestamp:date:ago]]


                I have also used this, but not often:

                [[+pubdate:fuzzydate]]