Crate feed [−] [src]
feed 1.2
This Library is for parsing through a rss field and creating a Feed
struct containing all elements of a Channel
based on the rss spec.
Usage
Put this in your Cargo.toml:
[dependencies]
feed = "1.2"
And put this in your crate root:
extern crate feed;
Examples
Reading Feeds
extern crate feed; extern crate url; use feed::FeedBuilder; use url::Url; fn main() { let url_str = "http://feeds2.feedburner.com/TheLinuxActionShowOGG.xml"; let url = Url::parse(url_str).expect("Url parse Error"); let feed = FeedBuilder::new().read_from_url(url).finalize(); let channel = feed.channel(); println!("Title: {}", channel.title()); }
Writing Feeds
extern crate feed; use feed::FeedBuilder; use feed::rss::ChannelBuilder; fn main() { let description = "Ogg Vorbis audio versions of The Linux ".to_owned() + "Action Show! A show that covers everything geeks care about in " + "the computer industry. Get a solid dose of Linux, gadgets, news " + "events and much more!"; let channel = ChannelBuilder::new() .title("The Linux Action Show! OGG") .link("http://www.jupiterbroadcasting.com") .description(description.as_ref()) .finalize(); let feed = FeedBuilder::new().channel(channel).finalize(); let xml = feed.to_xml(); println!("Feed: {:?}", xml); }
Modules
feed |
Implementation of |
feed_builder |
Implementation of |
feedio |
The feed can be converted to xml. |
itunes |
Not Yet Implemented |
media |
Not Yet Implemented |
rss |
All the structs for rss. |
Structs
Feed |
This |
FeedBuilder |
This |