RSS feeds are awesome for keeping up-to-date on the latest news and posts from your favourite sites. Up until now I’ve been using Mail.app as my primary RSS reader—and I really like it—but with an iPad and an iPhone always nearby, I’ve been meaning to set up Reeder instead.
Reeder uses Google Reader as a backend but there wasn’t an easy way to export my Mail.app RSS feeds into Google Reader—until I wrote the little script below to do it for me.
This PHP script reads the Mail.app settings and generates a MailAppToGoogleReader.opml file suitable for importing directly into Google Reader’s settings pane. All you have to do is copy the script to a file such as MailToGoogleReader.php and run the Terminal command:
$ php -e MailToGoogleReader.php
Now I can sit back and relax with Reeder on the iPad.
<?php
$opml = '<?xml version="1.0" encoding="ISO-8859-1"?>
<opml version="1.0">
<head>
<dateCreated>'.date('d-M-Y').'</dateCreated>
</head>
<body>
';
foreach (glob("/Users/jsambells/Library/Mail/RSS/*/Info.plist") as $plist) {
$xml = new SimpleXmlElement(file_get_contents($plist));
$results = $xml->xpath('//plist/dict[1]/key[.="RSSFeedURLString"]/following-sibling::*[1]/text()');
$url = (string)$results[0][0];
$opml .= '<outline type="rss" xmlUrl="' . $url . '"/>' . "\n";
}
$opml .= '
</body>
</head>
';
file_put_contents( "MailAppToGoogleReader.opml", $opml );
echo "done!";
`open .`;
Microsoft showed off their progress on Windows Phone 7 last night in New York and Into Mobile were able to capture some demo video with the new OS. You can see it running on pre-production hardware with the interesting UI. It looks pretty but I’m not sure how intuitive it will be for a novice user.
Check it out
With the new iPhone iOS 4, you can distribute apps wirelessly without iTunes intervention. You still need to collect the appropriate devices id’s and create the appropriate provisioning profiles but if you already have those sending out files is easy.
First, select “Build and Archive” from your XCode build menu. Your archived project will be stored in the “Archived Applications” section of the the XCode organizer (Window > Organizer).
Next, select the archive you want to distribute in the XCode organizer and select “Share Application…” at the bottom of the window. Pick the appropriate provisioning profile and then “Distribute for Enterprise”.
In the distribution window, enter the title and the full url to the ipa file (where you plan to host your app) for example, http://jeffreysambells.com/example.ipa.
Along with the generated .plist and the .ipa files, you’ll need the provisioning profile and a simple index file, for example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>My Cool app</title>
</head>
<body>
<ul>
<li><a href="http://jeffreysambells.com/example.mobileprovision">
Install Example Provisioning File</a></li>
<li><a href="itms-services://?action=download-manifest&url=http://jeffreysambells.com/example.plist">
Install Example Application</a></li>
</ul>
</body>
</html>
With these all uploaded to your server all you need to do is point people at the index file and they can select the links to install the provisioning profile and app directly from mobile safari on their iOS devices. A much nicer experience compared to installing through the iTunes sync process.
UPDATE
After re-publishing updates to my apps several times, I was finding it a little tedious to re-type the full url into the XCode tool—plus I could never remember what I named the damn files—so I came up with this quick and dirty index.php script to do the grunt work for me:
<?php
$ipas = glob('*.ipa');
$provisioningProfiles = glob('*.mobileprovision');
$plists = glob('*.plist');
$sr = stristr( $_SERVER['SCRIPT_URI'], '.php' ) === false ?
$_SERVER['SCRIPT_URI'] : dirname($_SERVER['SCRIPT_URI']) . '/';
$provisioningProfile = $sr . $provisioningProfiles[0];
$ipa = $sr . $ipas[0];
$itmsUrl = urlencode( $sr . 'index.php?plist=' . str_replace( '.plist', '', $plists[0] ) );
if ($_GET['plist']) {
$plist = file_get_contents( dirname(__FILE__)
. DIRECTORY_SEPARATOR
. preg_replace( '/![A-Za-z0-9-_]/i', '', $_GET['plist']) . '.plist' );
$plist = str_replace('_URL_', $ipa, $plist);
header('content-type: application/xml');
echo $plist;
die();
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Install iOS App</title>
<style type="text/css">
li {
padding: 1em;
}
</style>
</head>
<body>
<ul>
<li><a href="<? echo $provisioningProfile; ?>">Install Team Provisioning File</a></li>
<li><a href="itms-services://?action=download-manifest&url=<? echo $itmsUrl; ?>">
Install Application</a></li>
</ul>
</body>
</html>
It’s nothing fancy so you’ll probably want to spiff it up but to use it (you’ll need PHP), just create a folder and drop in the index.php along with the .mobileprovision file, the exported .ipa and the exported .plist. To make things easy just enter _URL_ (uppercase url with underscores) as the “url” in XCode and the script will automatically fill in the proper URL as necessary. It doesn’t matter what the file names are as long as there is only one .moblieprovision, .ipa and .plist.