# Sorting RSS feed

**URL:** <https://forum.kirupa.com/t/sorting-rss-feed/640727>\
**Category:** Uncategorized\
**Created:** [October 4, 2019, 2:04pm UTC](https://forum.kirupa.com/t/sorting-rss-feed/640727 "2019-10-04T14:04:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sukhwinder\_Saini](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@Sukhwinder\_Saini](https://forum.kirupa.com/u/Sukhwinder_Saini)\
**Post date:** [October 4, 2019, 2:04pm UTC](https://forum.kirupa.com/t/sorting-rss-feed/640727/1 "2019-10-04T14:04:48Z")

</div>

Hi, down below i am working on a RSS Feed code this code parse the feed from external server onto my browser. The problem is that this code parse the whole feed from the server but i need to parse only some of the information like: I want to parse only that item which matches with the string values say “windsor to Toronto” i only want to parse that item which match up with this string in description tag. I tried using for loop but didn’t workout. So, Here’s the actual code:

```auto
$(document).ready(function() {
	
  
   
   let feed="https://www.rssmix.com/u/9380040/rss.xml";
	console.log(feed);
	$.ajax(feed, {
		accepts:{
			xml:"application/rss+xml"
		},
		header: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST, GET, OPTIONS'
},
		dataType:"xml",
		crossDomain: true,
		success:function(data) {

			$(data).find("item").each(function () {
				var el = $(this);
				console.log("------------------------");
				var titleU= el.find("title").text();
				var title= titleU.toLowerCase();
				var link= el.find("link").text();
				var description= el.find("description").text();
				
				console.log(title);
				console.log(description);
				var find1= "windsor"
				var find2= "toronto"
				
                //Destination
				var destination= new RegExp('\\w*' + find1 + ' to ' +find2, 'ig');
				var dest=title.match(destination)
				console.log(dest);
				
			});
		}	
	});
});

```
