Welcome to openkapow Sign in | Join
in Search
.

[How to?] Show hyperlink in REST Output

Last post 04-24-2007, 2:17 PM by ppow. 7 replies.
Sort Posts: Previous Next
  •  04-17-2007, 8:06 PM 9576

    [How to?] Show hyperlink in REST Output

    .
    I modified searchgoogle20results to show a hyperlink instead of a plain text URL in the result.
    Inside Robomaker, I get the correct output.
    But when I execute the REST, characters such as "<" and ">" are transformed to "&lt;" and "&gt;", and the result cannot be interpreted as html. You can see at:

    http://service.openkapow.com/ppow/searchgoogle20results?searchText=kapow&resultformat=html&xml.rootElementName=&html.title=&html.style.stylesheetLink=&header=yes&json.callbackFunction=

    I do not want to see < a href="http://www.kapowtech.com/" > inside the result, I want to have an hyperlink instead.
    .

    Filed under: , , , ,
  •  04-18-2007, 5:30 AM 9590 in reply to 9576

    Re: [How to?] Show hyperlink in REST Output

    Hi,

    A REST service is not meant to return active html, and hence the <> is being encoded so that a html representation of the results can be displayed.

    In other words: You have to wrap your REST result in something that can turn the text based result set into HTML.
     


    The question is not:
    "Is it possible for a robot to ..." but rather:
    "How do I setup a robot to ..."
  •  04-18-2007, 1:32 PM 9613 in reply to 9590

    Re: [How to?] Show hyperlink in REST Output

    .

    Thanks, but could you be more specific? I want to have links appear in the html table returned by the REST. What do you mean by "wrap"? Could you give a concrete example?

    .

     

  •  04-19-2007, 2:11 AM 9618 in reply to 9613

    Re: [How to?] Show hyperlink in REST Output

    It is NOT possible to have the REST service return your results as active HTML.

    So: In order to have active links, you have to build some sort of application that use the information returned by the REST service in order to output HTML which can then display your link information as active links. Hence the reference to "wrap".


    The question is not:
    "Is it possible for a robot to ..." but rather:
    "How do I setup a robot to ..."
  •  04-22-2007, 10:40 PM 9672 in reply to 9618

    Re: [How to?] Show hyperlink in REST Output

    .
    Both claims
    "It is NOT possible to have the REST service return your results as active HTML"
    and
    "The question is not: "Is it possible for a robot to ..." "

    sound a bit antinomic.

    Basically, I want to rely on Openkapow to have some good-enough html output of the REST robot. If I have to program somehting on my side, this is not so convenient, and Openkapow loses some of its value.

    Anyway, I do like the html output returned by Openkapow. The blue ribon is nice, fonts are OK. But displaying hyperlinks is vital. Looking at your forum, I am not the first one to ask for active links in the REST html output. Having a URL as plain text in the output is not very useful.

    Could you not change something so that "<" signs remain "<" signs in the robot, and thus can be interpreted as html markup?

    If you stick to the idea that I have to do program it by myself outside Openkapow, then could you give a small tutorial on how to do this? I am slightly familiar with html and javascript, but not php. A small example giving the same output as in Openkapow + active link support would be fine.
    .


  •  04-23-2007, 6:21 PM 9730 in reply to 9672

    Re: [How to?] Show hyperlink in REST Output

    .
    Even Openkapow's own demo robots, do not support active html. I just ran:
    http://service.openkapow.com/demo/lonelyplanetproperties?country=Austria&resultformat=html&xml.rootElementName=&html.title=&html.style.stylesheetLink=&header=yes&json.callbackFunction=

    And get in the factoid field the following result:

    Perhaps the most unusual Austrian festival is <i>Perchtenlaufen</i>, held every January in Sazburger Land. The highlight is a street procession with men wearing heavy ornamental headdress, accompanied by younger men dressed as women.

    Here you can see the <i> markup. I'd rather see the text in italic than see the <i> markup.
    .

  •  04-24-2007, 3:55 AM 9739 in reply to 9672

    Re: [How to?] Show hyperlink in REST Output

    ppow:
    .
    Both claims
    "It is NOT possible to have the REST service return your results as active HTML"
    and
    "The question is not: "Is it possible for a robot to ..." "

    sound a bit antinomic.


    Not really... There’s a big difference between the robot (which CAN return HTML) and the REST service which can represent data via a HTML front-end.

    Sure it would be nice if the OpenKapow REST services would be able to represent active HTML as well, but then again there's properly a million nice things one could add on top of OpenKapow which no-one have event thought about at this point.

    In this case (having active HTML in a REST result) it can actually be achieve by using another component of OpenKapow: the clip functionality. I've tried to create a generic clip that take a REST service as input, and output the results with active HTML. It might not be 100% but it works with the original service you developed, and with the demo service.

    To use it do the following:

    1: Check that your REST service is working (e.g. http://service.openkapow.com/ppow/searchgoogle20results?searchText=kapow&resultformat=html&xml.rootElementName=&html.title=&html.style.stylesheetLink=&header=yes&json.callbackFunction=)

    2: Copy out the important part (here:/ppow/searchgoogle20results?searchText=kapow)

    3: Replace any = with : (explanation will follow)

    4: Load this clip service: http://service.openkapow.com/KVAKapowTech/activehtmlinrest. As you will see it take an input called WrapREST 

    5: Paste your content from (3) in the field and "invoke service"

    Alternatively you can go directly to this URL http://service.openkapow.com/KVAKapowTech/activehtmlinrest?WrapREST=%2Fppow%2Fsearchgoogle20results%3FsearchText%3Aopenkapow 

    Unfortunately the WrapREST field does not allow = in the string, hence you have to do the replacement.
     

    But there you go: A robot that wrap the result of a REST service in order to create active HTML.


    The question is not:
    "Is it possible for a robot to ..." but rather:
    "How do I setup a robot to ..."
    Filed under:
  •  04-24-2007, 2:17 PM 9789 in reply to 9739

    Re: [How to?] Show hyperlink in REST Output

    .
    The clip activehtmlinrest is great and solves the problem. Thanks a lot for this!
    Subject closed!
    .

View as RSS news feed in XML
.
Copyright 2006, 2007 KapowTech.com All Rights Reserved Company | Contact | Terms | Privacy