We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17705
    • 501 Posts
    Hi!
    In a website we have evo 1.04 installed... and we like to show a few twitter lines there...
    So, searching a way to show RSS feeds I have found RSS import, http://modx.com/extras/package/rssimport
    It looks really interesting, but... I can work it out, and I have no idea what to do now...

    I have downloaded it, uploaded the rss directory/files to the snippet directory... then created the snippet and did a TEST document, not caching, etc...
    First, the included PHx showed and error... so I tried using the latest version, and it seems to work...
    But, it just do a blank page... nothing at all, no error...

    The snippet call is like this one:
    [[!RSSoutput? &url=`http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=USERNAME`!]]
    (being USERNAME a twitter username...)

    Any idea? what to try/search/look for?
      • 4310
      • 2,310 Posts
      A quick & dirty snippet for returning the last 3 tweets for a given user :
      <?php
      $o = '';
      $i = 0;
      $xml = simplexml_load_file("http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=[USERNAME]");
      foreach($xml->channel->item as $key => $value){
      if ($i < '3'){
      $o .='<div class="tweet">';
      $o .= '<p>
      <b><a href="'.$value->link.'" title="'.$value->title.'">'.$value->title.'</a></b><br />
      '.$value->description.'
      </p>
      </div> <!-- /tweet -->';
      }
      $i++;
      }
      return $o;
      ?>
        • 17705
        • 501 Posts
        Interesting Bunk!
        That should work just using [[thesnippetname]]?


        BTW, I liked the rss import aproach because the cache thing... to not depend 100% on twitter servers...
          • 4310
          • 2,310 Posts
          Yes, just name your snippet something like RSSTweets and call it [[RSSTweets]]
          Don't forget to replace [USERNAME] in the snippet code and if you want more than the latest 3 tweets change that number in the code, also change of the html you want.
            • 13428 ☆ A M B ☆
            • 1,031 Posts
            Yo could try this: https://github.com/Jako/TwitX

            Main advantages:

            • Caching of the twitter api call
            • Templating of the output
            [ed. note: Jako last edited this post 13 years, 4 months ago.]
              • 17705
              • 501 Posts
              Thanks a lot!

              But... I have tried everything (the 3 resources talked here)... nothing worked!
              I just have a blank page, no idea why!? sad

              All the document properties looks ok... no chache, published... snippet call using [[!snippetname? properties...!]]
              tried using [!snippetname? properties...!] too... [ed. note: luuuciano last edited this post 13 years, 4 months ago.]
                • 13428 ☆ A M B ☆
                • 1,031 Posts
                Quote from: luuuciano at May 27, 2013, 07:39 AM
                Thanks a lot!
                I just have a blank page, no idea why!? sad

                If you get a blank page, then something should be wrong with your installation. Which PHP version? Which MODX version?

                TwitX works well on http://testseite.partout.info/testtwitter.html (PHP 5.2, MODX 1.0.10) with the following call:

                [!TwitX? 
                    &twitter_consumer_key=`xxx`
                    &twitter_consumer_secret=`yyy` 
                    &twitter_access_token=`abc` 
                    &twitter_access_token_secret=`xyz`
                    &timeline=`home_timeline`
                    &screen_name=`thjakobi`
                    &include_rts=`1`
                !]

                Use your key, token and secrets in the call.

                It has now a place in MODX repository: http://modx.com/extras/package/twitx [ed. note: Jako last edited this post 13 years, 4 months ago.]
                  • 17705
                  • 501 Posts
                  Well, that website has PHP 5.2.17...
                  I have tried using an absolute include path to... just in case something were wrong with the MODX_BASE_PATH variable, the same...

                  The website is using evolution 1.0.4...

                  No idea what can be wrong... do I need to have PHx installed too?
                  But it is odd, because none of the other two resources showed anything... mmm
                    • 13428 ☆ A M B ☆
                    • 1,031 Posts
                    Any errors in MODX system log?
                      • 17705
                      • 501 Posts
                      Well... I see a few quick edit module errors, and nothing more... do not know if it is related...
                      But it is really odd, because in fact there is no quick edit files on that path!
                      I will be updating that old evolution to the latest 1.10... sad