https://github.com/pratikpc/rss-parser-cxx
A header only C++ RSS Parser library. Supports C++20 generators
https://github.com/pratikpc/rss-parser-cxx
Last synced: over 1 year ago
JSON representation
A header only C++ RSS Parser library. Supports C++20 generators
- Host: GitHub
- URL: https://github.com/pratikpc/rss-parser-cxx
- Owner: pratikpc
- License: mit
- Created: 2021-05-21T18:08:20.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-06-07T10:12:50.000Z (about 5 years ago)
- Last Synced: 2025-02-12T00:38:43.910Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RSS Parser CXX
## Usage
```cpp
#include
int main()
{
namespace rss = pc::rss;
rss::Parser parse{str};
if (!parse)
{
std::cout << "Load failed";
return EXIT_FAILURE;
}
auto const channel = parse.Channel();
if (!channel)
{
std::cout << "Parsing failed";
return EXIT_FAILURE;
}
for (rss::Item const& item : channel.items())
{
auto const title = item.title();
if (title)
std::cout << "Title : " << *title << "\n";
auto const description = item.description();
if (description)
std::cout << "Description : " << *description << "\n";
for (std::string const& category : item.category())
std::cout << "Category : " << category << "\n";
std::cout << "================================\n\n";
}
auto const image = channel.image();
if (image)
{
std::cout << "Image : " << image.link() << "\n";
std::cout << "================================\n\n";
}
std::cout << "Skip Hours\n";
for (unsigned int const hour : channel.skipHours())
std::cout << "Skip this hour : " << hour << "\n";
std::cout << "================================\n\n";
std::cout << "Skip Days\n";
for (std::string const& day : channel.skipDays())
std::cout << "Skip this day : " << day << "\n";
std::cout << "================================\n\n";
return EXIT_SUCCESS;
}
```
## Depends on
- [pugixml](https://github.com/zeux/pugixml)
It helps us parse RSS documents