Parsing the html content..?

Login to reply to this topic.
Tue, 2007-02-20 16:07
Joined: 2004-06-22
Forum posts: 148
Hi,

I want to achieve something like this..

lets say i have a html page that has phone numbers as text on it..is there a way i can possibly parse the content of the html page to maybe pick up those phone numbers..and then provide the user the option to make calls on those numbers from the browser itself..maybe either by right clicking or something..or providing menu options for the same..?

I mean parsing happens on richtexteditor in uiq and it gives u the option to make calls and all..that much i know..but my case is quite different from the uiq scenario..how do i achieve something like this..?

I am targetting Series 60 3rd Edition/Series 60 Browser/Symbian 9.1
Cheers
mayank

Tue, 2007-02-20 19:06
Joined: 2004-05-24
Forum posts: 981
Re: Parsing the html content..?
If i understood well your question, why can't you make a search based on regular expressions? (instead of parsing everything)

pirosl

Tue, 2007-02-20 22:43
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 723
Re: Parsing the html content..?
Have you already tried Find Item engine (CFindItemEngine)?

Tote

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Wed, 2007-02-21 07:33
Joined: 2004-06-22
Forum posts: 148
Re: Parsing the html content..?
hi,

No i have not tried the same..do u have some code snippet for the same..would be good if u can share it..?

coz my doubt is that the CFindItemEngine searches for phone number etc in the given text..but i am not sure how to get the text..as the same is displayed in an html page..and there has to be some mechanism to read the contents of the page into a descriptor or something of that sort..right?

Cheers
mayank
Wed, 2007-02-21 08:43
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 723
Re: Parsing the html content..?
I thought you have the html content entirely. In a buffer or file, for example. So what is your use case, btw?

Tote

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Wed, 2007-02-21 09:16
Joined: 2004-06-22
Forum posts: 148
Re: Parsing the html content..?
No..i dont have that Undecided

Actually what i want to do is..lets say i have some content on the web page..say list of hotels and their phone numbers..what i want to do is give the user the option to make calls on those numbers from the browser itself..something like either on right click on the number on the page...the call gets initiated..or maybe provide the user with menu options on the browser to make calls...something like that..?

Cheers
mayank
Wed, 2007-02-21 10:12
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 723
Re: Parsing the html content..?
So you want to influence the way how a browser works? That's tough or in other words nearly impossible - unless the browser application in question does not support it. Btw, the built-in S60 browser has supported finding phone numbers and even making a calling to the given number for a long time, but it is now not supported in the new browser. But even if it supported that feature, I doubt that there would be an open API to enable/disable that feature.

Tote

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Wed, 2007-02-21 10:16
Joined: 2004-06-22
Forum posts: 148
Re: Parsing the html content..?
You could say i want to make the browser more feature rich..Smiley

But when u say supports making phone call etc..how exactly..i mean how can i make a call from the browser..what needs to be done..can u elaborate on its actual working..coz even i have read its possible..but how..is the question tat bugs me..Sad

Cheers
mayank
Wed, 2007-02-21 10:42
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 723
Re: Parsing the html content..?
No, it's not possible. How could you influence programmatically an application? Only if it exposed such an API (for example, a plug-in API) that would make it possible. Built-in S60 browser does not expose such an API - even though it exposes a few APIs none has something to do with dialing phone numbers. Actually, as I have already mentioned, the browser supported that feature (internally, though), but it's been removed from the new (OSS) browser.

Tote

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Wed, 2007-02-21 10:49
Joined: 2004-06-22
Forum posts: 148
Re: Parsing the html content..?
So what u r saying is that from the Series60 3rd Edition phones..its not possible to make call/send sms from the browser..?

Isnt there a way to read the contents of the html..coz if i can do that..the remaining things i will figure out..?

Cheers
mayank
Wed, 2007-02-21 10:55
Forum Nokia Champion
Joined: 2003-10-01
Forum posts: 723
Re: Parsing the html content..?
Nope, sorry. Neither does browser support these features nor does it make the downloaded html available to anyone else. However, there was a transition period where both old and new browser applications were on S60 3rd devices, but I can list you these devices by heart.

Tote

Gabor Torok
Software architect, Agil Eight (http://www.agileight.com/)
Blog: http://mobile-thoughts.blogspot.com/

Fri, 2007-03-02 18:22
Joined: 2004-05-29
Forum posts: 149
Re: Parsing the html content..?
I am going for a similar idea.  On the UIQ a Rich Text Editor (CEikRichTextEditor) can be constructed with a flag, ETextParsers, which will enable the text control to parse the text for phone numbers and URLs.  They will be underlined and if the user clicks on them there is a context menu to open the web browser/make a call. 

Unfortunately, on Series 60 there is a flag ENoTextParsers but not the opposite, and I can't get the darn thing to acknowledge URLs.  Can anyone offer me any advice?

Thanks!
-euroq
Fri, 2007-03-02 19:57
Joined: 2004-06-22
Forum posts: 148
Re: Parsing the html content..?
The Rich text in UIQ does its own parsing of the entire text...and thats why we get those options..we need to have a similar kind of implementation here in s60..but i guess none like that exists...we need to write a plugin for the parsing and stuff...but then there is no way to read the entire html content either...so we r kind of stuck

cheers
Fri, 2007-03-02 20:41
Joined: 2004-05-29
Forum posts: 149
Re: Parsing the html content..?
It seems that there is functionality somehow in there.   The SDK has hints in the headers having to do with text parsers.  There is a function in CEikRichTextEditor called
IMPORT_C void SetParserObserver(MEikRichTextEditorParserObserver* aObserver);
There is also a function in CEikEdwin's private subclass CEikEdwinExtension called
void CreateRichTextPhoneNumberFormatterL( CTextLayout& aTextLayout, const CRichText& aText );
(as well as a few others similar to that).

The Notepad application that comes installed uses a text parser that catches phone numbers and lets you call them.  I'm thinking there has to be a way to get to this functionality without reinventing the wheel.

Speaking of reinventing the wheel, I hope that there is at least a way to create your own text parser within the rich text editor.  That way you don't have to rewrite a text editor!
Wed, 2007-11-28 09:38
Joined: 2007-04-25
Forum posts: 1
Re: Parsing the html content..?

Any more info?

  • Login to reply to this topic.