title: Magento - programmatically save static block content
body: <p>I have a static block that I would like updating by a script which gets run via cron. </p>
  
  <p>I've found out how to create or retrieve a block programmatically, but not how to edit an existing one. </p>
  
  <p>This works to retrieve a block:</p>
  
  <pre><code>// Retrieve the layout object
  $layout = Mage::getSingleton('core/layout');
  
  // Generate a CMS block object
  $block = $layout-&gt;createBlock('cms/block');
  
  // Set the block ID of the static block
  $block-&gt;setBlockId('my_block_id');
  
  // Write the static block content to screen
  echo $block-&gt;toHtml();
  </code></pre>
  
  <p>I think I'm missing something simple here, but doing setContent() and then save() on this block just results in "Invalid method Mage_Cms_Block_Block::save"</p>