Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Bing API Version 2.0 - How to implement for site search. ASP.net, c# or vb, JSON or SOAP.

Posted on 2011-04-27
10
Medium Priority
?
1,136 Views
Last Modified: 2013-11-18
I want to learn how to do this. I have read a couple books on c# programming and worked through some examples, but I have no idea how to implement an API.

Bing recently did away with their site search because the API includes the same capabilities. They show an example of the API and how to get a developer code here: http://www.bing.com/developers

But I haven't found one place that shows how to set it up for a webpage. I also need to know how to work with either SOAP or JSON (One site I looked at suggested SOAP for c#). I don't even know if I need to install those things or just add it as a reference, etc.

I would really like to learn how to do this. It's a step that I need to take in order to learn more about programming. I know this may be a big question, but I don't know where else to learn how to do this. I even went to several sites looking for ANY API to see how to work with them but I'm not having any luck. I know it's a lot to ask, but what the heck - you guys are experts!

Any help would be greatly appreciated. If I need to break it down into several questions I would be glad to do so if someone would suggest how to do that.

TIA,
MHenry
0
Comment
Question by:MHenry
  • 5
  • 5
10 Comments
 
LVL 83

Expert Comment

by:leakim971
ID: 35501206
>But I haven't found one place that shows how to set it up for a webpage.
http://www.pckult.net/blog/recherche-avec-lapi-bing-grace-a-asp-net-et-jquery/

0
 
LVL 7

Author Comment

by:MHenry
ID: 35505825
leakim971,

I actually found an English version of that code here:
http://weblogs.asp.net/hajan/archive/2011/03/07/bing-search-using-asp-net-and-jquery-ajax.aspx

And I finally got that bit working over the weekend. But this example shows how to do a web search, not a site search.

I would also like to make it appear more like it used to, a popup window with the results in there.

Any help on that?

Best,
MHenry
0
 
LVL 83

Expert Comment

by:leakim971
ID: 35506219
If you add the keyworkd site: follwing the site you got result for a specific site
for example site:microsoft.com

you can easily put result in a css popup window or jquery dialog : http://jqueryui.com/demos/dialog/ 
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Author Comment

by:MHenry
ID: 35506429
Sorry, where would I put that? I got it working once, but don't remember how.

And when I did, it didn't limit the search to just my site. I was getting stuff like (for example) mysite.com, xmysite.com, xyzmysite.com.

It was pretty strange...
0
 
LVL 83

Expert Comment

by:leakim971
ID: 35506478
>Sorry, where would I put that?

in the url, when you build the search string, just like it's a term you're lookign for

var url = "http://api.search.live.net/json.aspx?JsonType=callback&JsonCallback=?&Appid="+ bingAPIKey + "&query=" + encodedKeyWords + "&sources=web&site%3Ayoudomain%2Ecom";

>And when I did, it didn't limit the search to just my site.
Yes, that is
0
 
LVL 7

Author Comment

by:MHenry
ID: 35506525
remembered how I got the results. I used this:
+ "&query=www.mysite.com"

But like I said, it also serves up stuff from other sites that have mysite.com in the url.

weird.
0
 
LVL 7

Author Comment

by:MHenry
ID: 35506687
I've tried:
              + "&sources=web" + "&site=mysite.com";

             + "&sources=web&site=mysite.com";
           
             + "&sources=web&site%3Amysite%2Ecom";

As well as about 100 other variations and nothing seems to be working. I either get results from the internet or nothing at all.
0
 
LVL 83

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 35506693
var url = "http://api.search.live.net/json.aspx?JsonType=callback&JsonCallback=?&Appid="+ bingAPIKey + "&query=" + encodedKeyWords + "%20site%3Awww%2Emysite%2Ecom" + "&sources=web&site%3Ayoudomain%2Ecom";
0
 
LVL 7

Author Comment

by:MHenry
ID: 35506967
Perfect. That worked. Thanks!

0
 
LVL 83

Expert Comment

by:leakim971
ID: 35507016
You're welcome! Thanks for the points!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question