macmerc

XML on OS X

By: Jon Gales

There aren’t many more computer acronyms more popular than XML. Go to the bookstore
and check out the internet section—it’s all XML. What happened to plain
old HTML? It’s old hat! Most people are probably wondering, "What can this
XML thing do for me?". Well basically for most of us, it saves us time.
Lots of time.

Meet NetNewsWire
Lite
; it’s a lightweight cocoa application that you will soon fall in love
with. What it does is take in XML feeds (in a flavor known as RSS
or really simple syndication) from the sites you choose and display it in beautiful
aqua. Sound lame? How about reading 30+ sites in under 10 minutes? Most of your
favorite sites are available in RSS (Yes, even MacMerc) which makes scanning
the Mac web a cinch. Want something besides Mac news? Well there are plenty
of choices from all genres that can be added in just a few clicks right from
NNW. Have a site you want to see a feed for, but can’t find one? Well there
probably is one at NewsIsFree.com
or Syndic8.com. Below is
a screen shot of my set up, viewing MacMerc’s feed

 

nnw1 XML on OS X

If you still aren’t convinced consider the fact that Radio,
Manilla, Movable
Type
, LiveJournal,
Blogger, pMachine,
Blosxom,
PHPNuke, PostNuke
and many more Content Management Systems all support RSS by default! That comes
out to millions of sites that all support a technology that is almost unknown
to anyone out of the closely knit blogosphere.

I improved the RSS support of MacMerc to
include our story summaries (what you see on the front page) in the feed. That
means right in NetNewsWire you can see if we’ve updated, read what the stories
are about and choose what to read up on further. You can set NNW to update every
30 minutes which lets you keep up to date and still get work done icon razz XML on OS X . It’s got
a dock icon that updates like Mail’s (a little red number showing the number
of unread items).

Any site that updates daily and doesn’t support RSS should think about it. The
easiest way to add support for your site is just to use one of the web publishing
tools that support it to make your web site. That way you don’t have to sling
code yourself. However, if you’re feeling lucky here is the format that your
file should follow and a few pointers:

 

<?xml version="1.0"
encoding="ISO-8859-1" ?>
<rss version="VERSION NUMBER">
<channel>
  <title>MacMerc.com – Start using RSS</title>
  <link>http://www.macmerc.com/rss</link>
  <description>You may already be a MacMerc!</description>

  <language>en-us</language>
<item>
  <title>This is the first story</title>
  <link>http://firstlink.com</link>
  <description>This is a description of the first item!</description>

</item>
</channel>
  </rss>

I added full RSS support to my AIM
Quotes
site by following the above format. It was such a simple script it
only took a few minutes to code. I was even able to include the IM’s with their
colors. To include HTML in your feed just convert the HTML to HTML entities.
If you are writing in PHP (like I usually am) there is a function for this,
htmlentities()
.

This is really basic as far as RSS is concerned but it shows the
premises of what is going on. You’ll notice that it looks like HTML with different
tags. That’s basically what it is, RSS just is a collection of standard tags.
That’s how a reader like NetNewsWire can parse these files. Although this demo
is really simple, you can do more advanced things with it such as including
permanent links, copyright information, last build dates, and a ton of other
information. To get the scoop check out UserLand’s RSS
page
. They are busy working on version 2.0 right now!

Tips for authoring:

  • Make sure to send the headers out as text/xml or your feeds will never
    work
  • Include new lines (
    ) after each line
  • To speed things up author the xml file when things are published, not
    upon request (you’ll save a ton of CPU cycles)
  • Include a button on your web page that points to your feed, no one benefits
    from a secret feed
  • If you feel the need you can include advertising in the feeds, just add
    it to your code base. Most likely it won’t be effective but you never know.
  • If you don’t have a good statistical traffic monitor on your web server,
    build a counter into the file that is used to serve the XML. That way you’ll
    know if people are taking advantage of your feed.
  • Convert HTML to HTML Entities to make it work in your feeds.

Tips for using feeds:

  • Subscribe to LOTS of sites in the beginning, find out what you like after
    a few days. This is a good way to find new sites (NetNewsWire has a bunch
    of sites built in).
  • To add LiveJournals, just add /rss to the journal’s address. (http://www.livejournal.com/users/USERNAME/rss)
  • MacMerc is by default in the sites drawer of NetNewsWire but our syndication
    address is: http://www.macmerc.com/backend.php
  • MacMinute (our favorite Mac news site) has an unlinked feed: http://www.macminute.com/headlines.xml.
    This isn’t built into NetNewsWire yet so make sure to add this one ASAP!
  • MacUpdate (our favorite Mac Download site) has an OS X feed: http://www.macupdate.com/mommy/macsurferx.php.
    This isn’t built into NetNewsWire yet so make sure to add this one ASAP!

 

Transfer Files via Firewire

Question: “I’m looking for an easy way to transfer files between two Macs and I don’t want to mess with all that network voodoo. What can I do?”



Answer: “Boot one of the Macs (preferably the lesser model) as a firewire target disk. All you have to do is connect the two Macs via a firewire cable, boot the master (preferably the higher model), then boot the other and hold down the ‘t’ key until you see a blue screen with a yellow firewire symbol. This Mac will now appear as a normal firewire hard disk on the master’s desktop. Unfortunately, if the two Macs don’t have firewire, then you’ll have to ‘mess with all that network voodoo’.”



target Transfer Files via Firewire



(Thanks go out to medicalmac.com for the image.)



Remember, if you have a question that you’d like answered, please submit it to macmanx@macmerc.com

Meet the Geeks

We are all kinds of excited here at MacMerc for this year’s World Wide Developer’s Conference. You know you’ll be there (virtually speaking). Now you can be there in style, with a few free downloads…

iStumbler

First off, there’s the mater of connecting. For those of you living the mobile lifestyle, you’ll want to take a look at iStumbler. This little program sniffs out open AirPort networks and gets you connected to them.

Internet Connect Scripts

These AppleScripts automate your connection to the internet and can launch applications and even sign-in to chat services. You will have to be comfortable with AppleScript to do some minor editing on these, but these scripts are a great way to get online and straight into the action!

iChatExporter

If you join the MacMerc live chat via iChat, this handy app will let you extract a text version of your chat logs. These are much easier to read and edit than the format that iChat stores them in.

ContactCreator

Undoubtedly, you’ll meet some new friends at the live chat event. The Contact Creator service is a fast way to make a new Address Book contact from any selected text. You’ll be able to add those chat alias’ to your Address Book without missing any of the action.

WWDC 2003 Agenda

For those of you going to the conference (or those playing along at home) you can download the complete agenda for your Palm device. It comes in an eBook and Web Clipping format.

Okay, now you’re all hooked up and ready for Monday and the big keynote. I hope to see you all in the chat rooms!

Brian