extern crate rss; extern crate htmlescape; use rss::ChannelBuilder; use rss::ItemBuilder; use actix_web::HttpResponse; use actix_web::body::Body; use crate::Settings; use crate::db::{establish_connection, ListingType, SortType}; use crate::db::community_view::SiteView; use crate::db::post_view::PostView; use self::rss::Item; pub fn get_feed() -> HttpResponse
{ let conn = establish_connection(); let site_view = match SiteView::read(&conn) { Ok(site_view) => site_view, Err(_e) => return HttpResponse::InternalServerError().finish(), }; let post = match PostView::list(&conn, ListingType::All, &SortType::New, None, None, None, None, None, true, false, false, None, None,) { Ok(post) => post, Err(_e) => return HttpResponse::InternalServerError().finish(), }; let mut items: Vec