<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: MT PHP API?</title>
	<link>http://ask.metafilter.com/42527/MT-PHP-API/</link>
	<description>Comments on Ask MetaFilter post MT PHP API?</description>
	<pubDate>Thu, 20 Jul 2006 06:29:03 -0800</pubDate>
	<lastBuildDate>Thu, 20 Jul 2006 06:29:03 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: MT PHP API?</title>
		<link>http://ask.metafilter.com/42527/MT-PHP-API</link>	
		<description>Movable Type PHP library: is it possible to use the PHP library in the same fashion as the perl library? &lt;br /&gt;&lt;br /&gt; Maybe I am not making sense. MT comes w/ the perl library, e.g. MT.pm, Entry.pm, etc.&lt;br&gt;
&lt;br&gt;
I&apos;ve taken lately to writing shell scripts and cron jobs in PHP, but I have one perl script (and another coming) that must be in perl cos they use the MT library to write an automated entry, e.g.:&lt;br&gt;
&lt;br&gt;
$entry = MT::Entry-&amp;gt;new;&lt;br&gt;
...&lt;br&gt;
$entry-&amp;gt;save;&lt;br&gt;
$mt-&amp;gt;rebuild_entry(Entry =&amp;gt; $entry, BuildDependencies =&amp;gt; true) or die $mt-&amp;gt;errstr;&lt;br&gt;
&lt;br&gt;
So but lately MT comes with an extensive PHP library (mt directory/php/lib). But it seems like this isn&apos;t really a library/API, but rather some basic functions. Is it possible to duplicate the above functionality using MT&apos;s php lib?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.42527</guid>
		<pubDate>Wed, 19 Jul 2006 15:36:34 -0800</pubDate>
		<dc:creator>xmutex</dc:creator>
		
			<category>movabletype</category>
		
			<category>blog</category>
		
			<category>php</category>
		
			<category>perl</category>
		
	</item> <item>
		<title>By: rsanheim</title>
		<link>http://ask.metafilter.com/42527/MT-PHP-API#654187</link>	
		<description>PHP can do pretty much anything Perl does, as its a full fledged language - so I&apos;m guessing you could rewrite the MT stuff into php.  I don&apos;t think you&apos;d want to, though, as MT is written in perl so you&apos;d basically have to rewrite a big part of MT in php -- not a small task.  &lt;br&gt;
&lt;br&gt;
For something like this, you&apos;d probably want to use webservices.  Thats the usual way to programmatically create/edit/read posts from a blog.  I&apos;m sure that MT supports the metaweblog API, so probably the best way to do is to get a PHP metaweblog library and have that talk to MT.&lt;br&gt;
&lt;br&gt;
MT &amp;amp; metaweblog - &lt;a href=&quot;http://www.movabletype.org/siteuk/docs/mtmanual_programmatic.html&quot;&gt;http://www.movabletype.org/siteuk/docs/mtmanual_programmatic.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.skepticats.com/lnblog/documentation/files/metaweblog-php.html&quot;&gt;metaweblog library in php&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
These links were from very quick google searches - you may find better resources/libraries if you look harder.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.42527-654187</guid>
		<pubDate>Thu, 20 Jul 2006 06:29:03 -0800</pubDate>
		<dc:creator>rsanheim</dc:creator>
	</item><item>
		<title>By: adamrice</title>
		<link>http://ask.metafilter.com/42527/MT-PHP-API#654254</link>	
		<description>I will second that the right way to do this would be through an xml-rpc call, rather than reinventing the wheel.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.42527-654254</guid>
		<pubDate>Thu, 20 Jul 2006 07:46:52 -0800</pubDate>
		<dc:creator>adamrice</dc:creator>
	</item><item>
		<title>By: bschoate</title>
		<link>http://ask.metafilter.com/42527/MT-PHP-API#654643</link>	
		<description>The PHP library that comes with Movable Type is 99%[1] read-only. It is meant to be used to dynamically render blogs. So there are no functions provided to create entries and/or rebuild the static pages from PHP. XMLRPC is the way to go.&lt;br&gt;
&lt;br&gt;
The other alternative is to use the Perl-based API and invoke that script from PHP.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;&lt;small&gt;[1]: The 1% I allude to above is a feature of MT 3.31 which lets you save back to the database plugin configuration settings by PHP-based plugins.&lt;/small&gt;&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.42527-654643</guid>
		<pubDate>Thu, 20 Jul 2006 13:48:07 -0800</pubDate>
		<dc:creator>bschoate</dc:creator>
	</item><item>
		<title>By: fooljay</title>
		<link>http://ask.metafilter.com/42527/MT-PHP-API#854350</link>	
		<description>^^^ The ultimate authority, btw...</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.42527-854350</guid>
		<pubDate>Mon, 12 Feb 2007 00:50:54 -0800</pubDate>
		<dc:creator>fooljay</dc:creator>
	</item>
	</channel>
</rss>
