// Zoe AIM Away Message RSS Feed Generator // // Seth King and Douglas Thrift // // $Id$ #include "Atom.hpp" Atom::Atom(const Buddy& buddy, const std::vector& messages, const Stamp& stamp) { api::FileOutputStream fout(buddy.getAtom() != "-" ? buddy.getAtom() : "/dev/null"); xml::TextWriter atom(buddy.getAtom() != "-" ? fout : api::Cout.GetStream()); xml::ScopeElement feed(atom, "feed"); atom.SetAttribute("version", "0.3"); atom.OpenElement("title"); atom.SetAttribute("mode", "escaped"); atom.OutputText(ext::String(buddy) + "'s Away Messages"); atom.CloseElement(); atom.OpenElement("link"); atom.SetAttribute("rel", "alternate"); atom.SetAttribute("type", "text/html"); // XXX atom.SetAttribute("href", "http://computers.douglasthrift.net/zoe.xml"); atom.CloseElement(); atom.OpenElement("author"); atom.OpenElement("name"); atom.OutputText(buddy); atom.CloseElement(); atom.CloseElement(); atom.OpenElement("tagline"); atom.SetAttribute("mode", "escaped"); atom.OutputText(ext::String(buddy) + "'s AIM Away Messages from the past 30 days."); atom.CloseElement(); atom.OpenElement("generator"); atom.SetAttribute("url", "http://computers.douglasthrift.net/zoe.xml"); atom.SetAttribute("version", "0.9"); atom.OutputText(Zoe::generator()); atom.CloseElement(); }