Check-in [cd827b4c75]
Logged in as anonymous
Overview
Comment:omit rss entries with no links
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: cd827b4c75cab52dab49a08e03d459b6d411f8b38ce74b8d2de701e59938447d
User & Date: arcade on 2021-11-10 07:28:05.951
Other Links: manifest | tags
Context
2021-11-13
06:58
0.2.0: huge inner revamp, I guess now replies should be correctly sent to users. check-in: 9171c791eb user: arcade tags: trunk
2021-11-10
07:28
omit rss entries with no links check-in: cd827b4c75 user: arcade tags: trunk
2021-11-06
12:26
migrate to telegram-bot pre0.9 and current tokio, also reorganize other depends check-in: b2297258c7 user: arcade tags: trunk
Changes
121
122
123
124
125
126
127


128
129
130
131
132
133



134
135
136
137
138
139
140
				let url = item.link().unwrap().to_string();
				posts.insert(date.clone(), url.clone());
			};
			*/
			match rss::Channel::read_from(&content[..]) {
				Ok(feed) => {
					for item in feed.items() {


						let date = match item.pub_date() {
							Some(feed_date) => DateTime::parse_from_rfc2822(feed_date),
							None => DateTime::parse_from_rfc3339(&item.dublin_core_ext().unwrap().dates()[0]),
						}?;
						let url = item.link().unwrap().to_string();
						posts.insert(date.clone(), url.clone());



					};
				},
				Err(err) => match err {
					rss::Error::InvalidStartTag => {
						let feed = atom_syndication::Feed::read_from(&content[..])
							.with_context(|| format!("Problem opening feed url:\n{}", &url))?;
						for item in feed.entries() {







>
>
|
|
|
|
|
|
>
>
>







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
				let url = item.link().unwrap().to_string();
				posts.insert(date.clone(), url.clone());
			};
			*/
			match rss::Channel::read_from(&content[..]) {
				Ok(feed) => {
					for item in feed.items() {
						match item.link() {
							Some(link) => {
								let date = match item.pub_date() {
									Some(feed_date) => DateTime::parse_from_rfc2822(feed_date),
									None => DateTime::parse_from_rfc3339(&item.dublin_core_ext().unwrap().dates()[0]),
								}?;
								let url = link.to_string();
								posts.insert(date.clone(), url.clone());
							},
							None => {}
						}
					};
				},
				Err(err) => match err {
					rss::Error::InvalidStartTag => {
						let feed = atom_syndication::Feed::read_from(&content[..])
							.with_context(|| format!("Problem opening feed url:\n{}", &url))?;
						for item in feed.entries() {