<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fremus.co.za &#187; Linq</title>
	<atom:link href="http://www.fremus.co.za/blog/tag/linq/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fremus.co.za/blog</link>
	<description>Demistifying Life and Web Development</description>
	<lastBuildDate>Sun, 27 Nov 2011 15:56:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Getting search results from Bing REST service and using LINQ to process results</title>
		<link>http://www.fremus.co.za/blog/2009/10/getting-search-results-from-bing-rest-service-and-using-linq-to-process-results/</link>
		<comments>http://www.fremus.co.za/blog/2009/10/getting-search-results-from-bing-rest-service-and-using-linq-to-process-results/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 15:18:38 +0000</pubDate>
		<dc:creator>fr3dr1k</dc:creator>
				<category><![CDATA[Bing]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ to XML]]></category>
		<category><![CDATA[Bing API]]></category>
		<category><![CDATA[Bing REST]]></category>
		<category><![CDATA[Linq]]></category>

		<guid isPermaLink="false">http://www.fremus.co.za/blog/?p=520</guid>
		<description><![CDATA[So today I started reading about the Bing API and I got myself an API key and I read through the basic instruction manual, which tells you how to get search results from the web through the Bing REST service. Its pretty straight forward, just get your own key though! But here is some sample [...]]]></description>
			<content:encoded><![CDATA[<p>So today I started reading about the Bing API and I got myself an API key and I read through the basic instruction manual, which tells you how to get search results from the web through the Bing REST service. Its pretty straight forward, just get your own key though! But here is some sample code that does the trick and uses Linq to XML to process the results:</p>
<pre name="code" class="csharp">
            XDocument document = XDocument.Load("http://api.search.live.net/xml.aspx?Appid=<YourApiKey>&#038;query=sushi&#038;sources=web");
            XElement root = document.Root;
            XNamespace web = "http://schemas.microsoft.com/LiveSearch/2008/04/XML/web";
            var searchItems = document.Descendants(web + "Results").SingleOrDefault();

            IEnumerable<XElement> testelem = from el in searchItems.Elements()
                                                 select el;
            foreach (XElement myElem in testelem)
            {
                context.Response.Write(myElem.Value + "");
            }
</pre>
<p>That is very easy!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save" onclick="urchinTracker('/outgoing/www.addtoany.com/share_save?referer=');"><img src="http://www.fremus.co.za/blog/wp-content/plugins/add-to-any/favicon.png" width="16" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.fremus.co.za/blog/2009/10/getting-search-results-from-bing-rest-service-and-using-linq-to-process-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

