none
Bing Api sample

    Question

  • Hi

    I used the sample in http://learn-it-stuff.blogspot.com/2012/09/using-bing-custom-search-inside-your.html and the output is like this:

    Output from Server ....

    Find index: 1014
    Total index: 2014
    Find index: 1014
    Total index: 2014
    A computer is a general purpose device that can be programmed to carry out a finite set of arithmetic or logical operations. Since a sequence of operations can be ...


    But I need the output in a form that old sample(http://www.bing.com/blogs/site_blogs/b/developer/archive/2009/05/28/using-the-live-search-api-version-2-0-beta-with-java-and-the-api-s-soap-interface.aspx) had.

    like this:

    Live Search API Version 2.0
    Web results for computer
    Displaying 1 to 10 of 758000 results

    Title:COMPUTER:
    Description:Mainframe computer: This is the computer, which is used in a large organization as a server in the network having DT (Dump Terminals) and IT (Intelligent Terminals) ...
    Url:http://www.freewebs.com/rasikh-jan/Computer%20Hardware.doc
    Last Crawled:2013-05-27T09:17:00Z

    Title:COMPUTER HARDWARE AND SOFTWARE
    Description:Computer systems can also be categorized as having either an open architecture or a closed architecture. An open architecture allows third-party vendors to develop ...
    Url:http://www.swlearning.com/accounting/hall/ais_4e/hardware.doc
    Last Crawled:2013-06-19T15:18:00Z

    Title:Computer Hardware
    Description:A computer collects, processes, stores and outputs information. Input Device - Lets you communicate with a computer. A keyboard, mouse, and joystick are input devices.
    Url:http://home.ite.sfcollege.edu/class/CGS1030/File_Management/Computer%20Hardware.doc
    Last Crawled:2013-06-19T05:35:00Z


    How is it possible?
    Please help me

    Saturday, June 22, 2013 8:27 AM

Answers

  • Hi,

    You can mix these two samples for using Bing search API in java, though I am not a java guy. In the first link it creates the custom output for the results. You can see how it formats using System.out.println() method. You can remove these code and use the code in the second link (in DisplayResponse() function) instead to build that kind of output format you wish. I think this code is easy for your java guy to understand (just some print line jobs).

    Thanks,


    QinDian Tang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by melisa2020 Monday, June 24, 2013 5:21 PM
    Monday, June 24, 2013 3:00 AM
    Moderator