// Blog // // Douglas Thrift // // $Id$ #include #include #include #include #include "Blog.hpp" Blog::Blog(const cse::String &sitemap, const cse::String &base, ext::Queue &queue, api::ThreadMutex &queueLock, const _R &command) : CommandRunner(sitemap, queue, queueLock) { api::Cout << _B("Blog") << ios::NewLine; Entries(command->root, /*_S() << base << command->path*/_B("http://www.douglasthrift.net/blog/")); } void Blog::Entries(const api::Path &directory, const cse::String &base) { { cse::String blog(client.GetProperty(_B("GoogleTron:Blog"), directory.GetPath())); if (blog != _B("MovableType")) throw ext::NotImplementedException(_S(_B("unknown blog ")) << blog); } _R driver(dbi::GetDriver(client.GetProperty(_B("GoogleTron:Driver"), directory.GetPath()))); _R connection(driver->Connect(client.GetProperty(_B("GoogleTron:Host"), directory.GetPath()), client.GetProperty(_B("GoogleTron:User"), directory.GetPath()), GetPassword(directory), client.GetProperty(_B("GoogleTron:Database"), directory.GetPath()))); int32_t id; { _R set(connection->Parse(_B("SELECT blog_id FROM mt_blog WHERE blog_site_url = ?"))->Execute(base)); if (set->MoveNext()) id = set->Get(0); else throw ext::StringException(_S("no blog ") << base); } }