This shows a very simple example on how to create content dynamicaly.

The problem: automatically populate a folder with a list of links
The solution:

1. create a script object in that folder (using the zope interface)
2. edit this script to create the links using data from a source (in my case I just wrote an external script which generated the array but in your case you might read the list from different other sources

# Simple script to programatically create a list of links
# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE

#replace this with your own way to get your data
links = [
['http://len.is-a-geek.org/photo/icebike', 'Azuga ice', 'Azuga, Baiului mountains, ian 2005 cipcam'],
['http://len.is-a-geek.org/photo/baiului30oct', 'Baiului 1600m', 'Baiului mountains, oct 2004 cipcam'],
['http://len.is-a-geek.org/photo/iezer_mtb', 'iezer mtb', 'short biking trip in iezer, cipcam'],
['http://len.is-a-geek.org/photo/on_mogosoaia_ice', 'mogosoaia - frozen lake', 'mogosoaia, frozen lake ian 2004'],
['http://len.is-a-geek.org/photo/zapada', 'winter', 'biking in the snow']
]

for l in links:
   lid = l[1].replace(' ','-')
   container.invokeFactory('Link', id=lid)
   container[lid].edit(remote_url=l[0], title=l[1], description=l[2])

return "Created list"

3. Execute the script using the “test” tab.

References:

  • how-to on plone.org
  • read the source of CMFPlone/tests/testContentTypes.py