We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25483
    • 741 Posts
    I want to archive them on my own site and add the option to leave a comment at the collected articles.
      with regards,

      Ronald Lokers
      'Front-end developer' @ h2o Media

    • You can probably create a snippet which calls feedx and take its output and do a create chunk based on whatever criteria (such as month day) as the name.

      I created a snippet with such a function in it which should give you a start....

      	function makeChunk($chunkName, $chunkContent) {
      
      		global $modx;
      
      		if ($modx->getChunk($chunkName)) {// chunk provided in &lookupStrMakeChunk already exists so we abort
      
      			$lookupOutput = $chunkName . ' already exists, exiting...';		
      
      		}else{
      
      			$chunkName = $modx->db->escape($chunkName);
      
      			$table = $modx->getFullTableName('site_htmlsnippets');
      
      			$fields['name'] = $chunkName;
      
      			$fields['description'] = $chunkName;
      
      			$fields['editor_type'] = '0'; // plain text
      
      			$fields['category'] = '0';  // places content in the uncategorized category
      
      			$fields['snippet'] = $modx->db->escape($chunkContent);
      
      			$fields['locked'] = 1;		// locks the chunk so only site admin can make changes or unlock it
      
      			$sqlResult = $modx->db->insert($fields,$table);
      
      			if($modx->db->getAffectedRows()){			
      
      				$lookupOutput = $chunkName .' created succesfully into the uncategorized category!';
      
      				// I need to clear the cache on this calling document here as the newly created chunk can not be correctly detected until this is done
      
      				// Current modx documentation does not indicate how this can be done. I will have to read through the manager source to see how they call it
      
      			}else{
      
      				$lookupOutput = 'Error creating new chunk: '. $chunkName;
      
      			}		
      
      		} 
      
      		return $lookupOutput;
      
      	}
        Get your copy of MODX Revolution Building the Web Your Way http://www.sanitypress.com/books/modx-revolution-building-the-web-your-way.html

        Check out my MODX || xPDO resources here: http://www.shawnwilkerson.com
        • 29635
        • 361 Posts
        If anybody’s interested I just created a basic little snippet that’ll:
        - pull from a feed (it’s actually currently set up to pull from Vimeo’s serialized PHP output, but making it read XML should be no problem).
        - create documents (with TVs) based on data in the feed.
        - default is to ignore items that already exist (based on comparing a unique ID in the XML/array to the pagetitle or longtitle value), but optionally set it to "overwrite" mode to overwrite existing documents with data from the feed.

        I’ll be posting this in a week or two if I remember, but if you want it now or if I forget let me know. It’s really not that complicated, though it’ll require some tweaking to make sure the right fields from the feed go to the right TVs or document objects. It seems remarkably solid, though, fwiw.
          Need MODx Ecommerce? Try FoxyCart!
          • 7231
          • 4,205 Posts
          That sounds great. I may be needing something like this on an upcoming project where the client wants to store data from an XML feed. I will keep an eye open for the release grin
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 25483
            • 741 Posts
            Quote from: The at Dec 02, 2008, 09:42 PM

            If anybody’s interested I just created a basic little snippet that’ll:
            - pull from a feed (it’s actually currently set up to pull from Vimeo’s serialized PHP output, but making it read XML should be no problem).
            - create documents (with TVs) based on data in the feed.
            - default is to ignore items that already exist (based on comparing a unique ID in the XML/array to the pagetitle or longtitle value), but optionally set it to "overwrite" mode to overwrite existing documents with data from the feed.

            I’ll be posting this in a week or two if I remember, but if you want it now or if I forget let me know. It’s really not that complicated, though it’ll require some tweaking to make sure the right fields from the feed go to the right TVs or document objects. It seems remarkably solid, though, fwiw.

            Cool, can’t wait to see it laugh
              with regards,

              Ronald Lokers
              'Front-end developer' @ h2o Media

              • 6726
              • 7,075 Posts
              I’ll do check this out too, as a SweetCron user I am interrested in getting this feature...

              Did you give a look @SweetCron’s code ? It’s based on CodeIgniter, thus it’s probably not usable "as is" but maybe as food for thought...
              BTW SweetCron works not only for twitter but several social services...
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l'outil id
                • 6726
                • 7,075 Posts
                Lots of them are CodeIgniter files and as far as twitter is concerned, I might be wrong but it would seem to be located in system/application/plugins/twitter_com.php and system/application/plugins/search_twitter_com.php. Also system/application/models/feed_model.php

                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                  • 18338
                  • 31 Posts
                  Did this effort ever go anywhere? I have been making extensive use of RSS in my work recently, and I can imagine some interesting possibilities if this kind of integration were possible.
                    • 29635
                    • 361 Posts
                    I’ll whisper you my Vimeo code. May not actually be useful, as a lot of it is hardcoded, but it’s a start.
                      Need MODx Ecommerce? Try FoxyCart!
                      • 19975
                      • 429 Posts
                      I would also be interested in a script to import data for conversion to content nodes. If such a script exists please do let me know smiley
                        Martin Sanders - Design & Web Development