Hi Steven,

We understand your issue, but unfortunately changing the User Agent is 
not supported. You can bypass that restriction by downloading the page 
in your code either to an in-memory java String or to a local temporary 
file. You can pass annotate a document, contained in a string with 
KIMDocument kdoc = apiCorpora.createDocument(contentInAString) . You can 
annotate HTML in a local file by passing a file:// URL to createDocument.

Hope that help. Please ask if you need more information.

Best,
Marin Nozhchev

steven shingler wrote:
> Hi Danail, Thanks for getting back...
>
> Basically, I'm doing something very simple:
>
> snippet:
> ////////
>
> KIMService serviceKim = GetService.from(kim_host, kim_port);
> apiCorpora = serviceKim.getCorporaAPI();
> apiSemAnn = serviceKim.getSemanticAnnotationAPI();
> KIMDocument kdoc = apiCorpora.createDocument(new URL(url), "UTF-8");
> kdoc = apiSemAnn.execute(kdoc);
> System.out.println(kdoc.getContent());
>
> If trying to do this with something like:
> http://news.google.co.uk/news/url?sa=T&ct=uk/6-0&fd=R&url=http://www.timesonline.co.uk/tol/sport/cricket/article3488177.ece&cid=1139453884&ei=GprOR_r5GaCm8AKlroStDw
>
> Then I get a 403 error - I think passing in a User-Agent property, as
> I mentioned on the first post in this thread would fix this.
> Hope that makes sense.
> Thanks,
> Steven
>
> On Thu, Mar 6, 2008 at 12:30 PM, DanKo <[EMAIL PROTECTED]> wrote:
>   
>> Hi Steven,
>>
>>  Can you add some details to your case:
>>  1) What is your browser ?
>>  2) Can you send some URL ?
>>
>>  We will try to reproduce the situation and get back to you asap.
>>
>>  All the best,
>>  Danail Kozhuharov (DanKo)
>>
>>
>>
>>  ----- Original Message -----
>>  From: "steven shingler" <[EMAIL PROTECTED]>
>>  To: <[email protected]>
>>  Sent: Wednesday, March 05, 2008 3:34 PM
>>  Subject: [KIM-discussion] possible to pass kim User-Agent property?
>>
>>
>>  > Hi,
>>  >
>>  > I am using KIM to annotate some documents from the internet.
>>  >
>>  > I get a 403 error on some urls - is it possible to pass a User-Agent
>>  > property into KIM somehow?
>>  >
>>  > Such as:
>>  > con.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE
>>  > 5.5; Windows NT 5.0; H010818)");
>>  >
>>  > Thanks,
>>  > Steven
>>  >
>>  > _______________________________________________
>>  > NOTE: Please REPLY TO ALL to ensure that your reply reaches all members of
>>  > this mailing list.
>>  >
>>  > KIM-discussion mailing list
>>  > [email protected]
>>  > http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com
>>  >
>>  > __________ NOD32 2922 (20080305) Information __________
>>  >
>>  > This message was checked by NOD32 antivirus system.
>>  > http://www.eset.com
>>  >
>>  >
>>
>>
>>     
>
> _______________________________________________
> NOTE: Please REPLY TO ALL to ensure that your reply reaches all members of 
> this mailing list.
>
> KIM-discussion mailing list
> [email protected]
> http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com
>
>   


_______________________________________________
NOTE: Please REPLY TO ALL to ensure that your reply reaches all members of this 
mailing list.

KIM-discussion mailing list
[email protected]
http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com

Reply via email to