We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40735
    • 119 Posts
    Hi!
    I'm trying to get a Twitter feed with getFeed but it's not working. I get the following error in the MODx error log:

     [2013-03-22 12:00:12] (ERROR in getFeed @ /newcms/ttu1core/cache/ttu1config/includes/elements/modsnippet/4.include.cache.php : 51) Error parsing RSS feed at https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=tennesseetech
    


    The snippet call:

    [[!getFeed? &url=`https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=tennesseetech`
    						&tpl=`twitter`
    						&limit=`6`]]


    I'm running MODx Revo 2.2.6. If I load the URL in my browser it works fine. Loading the same feed via getFeed on a different server, running 2.2.4, works fine.
    What am I doing wrong?
    Thanks!
      • 40735
      • 119 Posts
      Anyone?
        • 38723
        • 165 Posts
        Quote from: dwillis210 at Mar 26, 2013, 08:39 AM
        Anyone?

        Twitter API 1.0 has been officially deprecated, so you'd be best using a different extra to pull in a JSON version of your Twitter feed. I wrote an extra which will do the hard work for you, see here if you want to give it a try: http://modx.com/extras/package/jsonderulo

        There's a link on there to the GitHub repo which should have all the info you'll need to get up and running!
          • 40735
          • 119 Posts
          Thanks! I'll check this out.

          I still don't understand why the exact same snippet call to the exact same Twitter feed works on one server and not another though. If the problem was Twitter's API being deprecated it seems like the calls would quit working everywhere.
            • 38723
            • 165 Posts
            Quote from: dwillis210 at Apr 15, 2013, 09:13 AM
            If the problem was Twitter's API being deprecated it seems like the calls would quit working everywhere.

            I think they were doing blackout tests not so long ago and sometimes they were responding, sometimes not. Best just to go straight for the 1.1 API smiley
              • 39018
              • 15 Posts
              It is the getFeed-package that is causing the problem in combinatien with the twitter-feed. When I load the rss directly in the browser, I see results and the XML looked well-formed. But something is breaking it (see the modx-errorlog).
                • 18373 ☆ A M B ☆
                • 3,141 Posts
                You really should start using the 1.1 API already. Twitter is doing another blackout test this wednesday, and the API will be shut down completely in June. If you're implementing this getFeed approach now, you will have an angry client on the phone by next month.

                I've updated the RTFM post for twitter with getFeed to discourage usage: http://rtfm.modx.com/display/ADDON/getFeed.Adding+a+Twitter+Feed
                  Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                  Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.