Somewhere between design and development

Connecting BlogPress (on the iPhone) to Drupal for blogging

It's not totally clear how to connect BlogPress - a cheap blogging app on the iPhone - to a Drupal blog. There's a bit of tinkering needed on the Drupal side to enable XML-RPC and the Blog API along with the permissions and then the setting up of BlogPress.

Drupal

  1. In Administer -> Site Building -> Modules enable Blog (obviously) and Blog API.
  2. Check that XML-RPC is working but going to http://yoursite/xmlrpc.php and you should get an error message saying "XML-RPC server accepts POST requests only." The only reason I say to check that is that upon installing Drupal there is a recommendation to delete that file if it's never going to be needed which someone may have assumed.
  3. Setup the permissions for the Blog and Blog API (Administer -> Users -> Permissions).
  4. In Administer -> Site Configuration -> Input Formats enable Full HTML for the users who will be using the Blog API ('configure' and then select the 'Roles'). In actual fact you may need to set this as the default for Blogs at least otherwise the code will be there for any images you embed via Flickr or Picassa but they won't show up when the page is viewed. See note at the bottom of the page.

BlogPress

BlogPress on the iPhone

  1. Go to Settings and 'Add another blog'.
  2. Choose a Blog Service Provider of Drupal
  3. Enter your username and your password.
  4. In the Blog URL field enter http://www.yoursite.com/xmlrpc.php
  5. Click 'Save' and you should be done (it will try and connect and say if it fails).

Blog URL

The Blog URL field in the settings on BlogPress is what threw me for a bit and sent me off googling. Obviously the URL it needs is not the URL of your blog but of your site (multiple users on the same site would use the same xmlrpc.php URL). But you also have to bear in mind that BlogPress is not a browser and so if yoursite.com redirects to www.yoursite.com your browser will happily follow the redirect but BlogPress won't and will fail. So if http://www.yoursite.com/xmlrpc.php doesn't work then use http://yoursite.com/xmlrpc.php.

Input Formats

If you're into Drupal as anything other than a user with an account, you are probably fully aware how the input formats work. If you don't then here's a quick summary: Input Formats don't affect the input, they only affect the output.

Neat huh? Actually it is because whatever you enter into Drupal will be stored in Drupal in its raw form so nothing gets lost or filtered until you try and display it at which point the input format can kick in and filter out dodgy text. With BlogPress it will put in place the HTML tags needed to display images but if Drupal isn't configured to allow those tags your photos will only show up when you're editing and not in the output your visitors will see.

So you need to either work out the exact tags that BlogPress uses and allow those or just allow full HTML. As this site and the other one I use are only used by me and I trust myself I'm happy to allow full HTML. If you have a site where you don't trust all your users then you may need to start learning about filters to create one that BlogPress can use but your users can't abuse.