diff --git a/src/AtomFeed.cpp b/src/AtomFeed.cpp index c034b65..7e52069 100644 --- a/src/AtomFeed.cpp +++ b/src/AtomFeed.cpp @@ -79,6 +79,7 @@ AtomFeed::EntryParse ( Config* cfg, tinyxml2::XMLElement* xentry ) newEntry->SetTitle( xentry->FirstChildElement("title") ); newEntry->SetPostUrl( xentry->FirstChildElement("link")->Attribute("href") ); + newEntry->SetFeedTitle( title ); bool set = false; set = newEntry->SetDesc( xentry->FirstChildElement("summary") ); diff --git a/src/Entry.cpp b/src/Entry.cpp index 6c5efa3..8dcbf49 100644 --- a/src/Entry.cpp +++ b/src/Entry.cpp @@ -10,6 +10,7 @@ Entry::Entry ( BString outputPath ) { title = BString(""); description = BString(""); + feedTitle = BString(""); postUrl = BString(""); content = BString(""); outputDir = outputPath; @@ -32,6 +33,8 @@ Entry::Filetize ( Config* cfg, bool onlyIfNew = false ) title.String(), title.CountChars() ); file->WriteAttr( "FEED:description", B_STRING_TYPE, 0, description.String(), description.CountChars() ); + file->WriteAttr( "FEED:source", B_STRING_TYPE, 0, + feedTitle.String(), feedTitle.CountChars() ); file->WriteAttr( "META:url", B_STRING_TYPE, 0, postUrl.String(), postUrl.CountChars() ); if ( date != NULL ) { @@ -52,7 +55,6 @@ bool Entry::SetTitle ( tinyxml2::XMLElement* elem ) { if ( elem != NULL ) return SetTitle( elem->GetText() ); return false; } - bool Entry::SetDesc ( const char* descStr ) { if ( descStr != NULL ) description = BString( descStr ); else return false; @@ -62,6 +64,11 @@ bool Entry::SetDesc ( tinyxml2::XMLElement* elem ) { if ( elem != NULL ) return SetDesc( elem->GetText() ); return false; } +bool Entry::SetFeedTitle ( BString titleStr ) { + if ( titleStr != NULL ) feedTitle = titleStr; + else return false; + return true; +} bool Entry::SetContent ( const char* contentStr ) { if ( contentStr != NULL ) content = BString( contentStr ); diff --git a/src/Entry.h b/src/Entry.h index 10f6bd1..8574499 100644 --- a/src/Entry.h +++ b/src/Entry.h @@ -12,6 +12,7 @@ class Entry { public: BString title; BString description; + BString feedTitle; BDateTime date; BString postUrl; BString content; @@ -25,6 +26,7 @@ public: bool SetTitle ( tinyxml2::XMLElement* ); bool SetDesc ( const char* ); bool SetDesc ( tinyxml2::XMLElement* ); + bool SetFeedTitle ( BString ); bool SetContent ( const char* ); bool SetContent ( tinyxml2::XMLElement* ); bool SetPostUrl ( const char* ); diff --git a/src/Mimetypes.cpp b/src/Mimetypes.cpp index 330be33..863f16a 100644 --- a/src/Mimetypes.cpp +++ b/src/Mimetypes.cpp @@ -21,6 +21,7 @@ feedMimeType ( ) addAttribute( info, "FEED:name", "Name" ); addAttribute( info, "FEED:description", "Description" ); addAttribute( info, "META:url", "URL" ); + addAttribute( info, "FEED:source", "Source" ); addAttribute( info, "FEED:when", "When", B_TIME_TYPE, true, false, 150 ); mime.SetAttrInfo(&info); diff --git a/src/RssFeed.cpp b/src/RssFeed.cpp index c1de441..30e793f 100644 --- a/src/RssFeed.cpp +++ b/src/RssFeed.cpp @@ -66,6 +66,7 @@ RssFeed::EntryParse ( Config* cfg, tinyxml2::XMLElement* xitem ) newEntry->SetDate ( xitem->FirstChildElement("pubDate") ); newEntry->SetPostUrl ( xitem->FirstChildElement("link") ); newEntry->SetContent ( xitem->FirstChildElement("content:encoded") ); + newEntry->SetFeedTitle( title ); if ( lastDate == NULL || lastDate < newEntry->date ) lastDate = newEntry->date;