webOS Nation Forums

webOS Nation Forums (/)
-   webOS Development (http://forums.webosnation.com/webos-development/)
-   -   webOS Intelligent News Reader - "wInNeR" (http://forums.webosnation.com/webos-development/321063-webos-intelligent-news-reader-winner.html)

72ka 01/08/2013 08:59 AM

webOS Intelligent News Reader - "wInNeR"
 
2 Attachment(s)
Hi all,
just want to share my new project idea. I'm very disappointed that my carrier data quota is almost every month filled in the middle of the month. The main reason is my every day news reading while going to work and back to home. Standard webOS browser is good enough to read the news, but the cache management isn't sufficient, if I'm going to the previous page, some data are refreshed.
RSS or other technologies doesnīt meet my requirements, because my favorite discussions under each article are omitted or forwarded to standard browser.
I really miss something like Opera mini, where my needs are covered by only 15Mbytes per month.
Thus, I decided to write some very simple browser designed for mobile news.

[B]Main objectives:[/B][LIST][*]- to gain more Enyo skills (for future openWebOS apps) - in progress, switching to Enyo 2[*]- reduce data transfer as possible (mobile proxy, image compression) - done using google proxy[*]- ability to cache everything (stored in database, only manual refresh on again-visited pages) - partially[*]- should work on webOS phone - done[*]- user adjustable font size, same size for portrait and landscape - done[/LIST]
[B]Issues:[/B]
The common Enyo issue is, that webview widget doesnīt work on phones at all... sadly, no way there for me.
No free online image compression tool

How to do it?

[B]Proof of concept:[/B]

To set an simple Enyo kind with html content (as string) and show it. The html content is ajax response to GET from google mobile proxy (mobile optimized page with image compression). Then, I can parse the html string response, removed some strings, tags, connected the pages generated from google to one page again, etc... I had to write some functions to get the links to work and images to show... but well.

[B]Results:[/B]

I have a first proof of concept application, where I can read the news with minimized data transfer and the same font size in both orientations! Able to read mobile or non-mobile optimized pages. Forget the horrible UI please :)... it is in early stage, one day old app and I named it "wInNeR" :)

ToDo:

It is designed for my needs.... if someone like the app, the idea, I can share it for testing, whenit will be more stable.

geekpeter 01/08/2013 09:18 AM

nice, i wonder if you can mimick the Zite app, which i believe also strips news from multiple sources then reformats it to its own look/theme/feel, only their not worried about data useage.

It's a good idea tho. would be nice to have the next best thing to opera.

Considering how integrated our stock browser is, its a shame there cant be a toggle switch for the normal browsers/webkit to act normal or in your new method, theres the isis code out there to mess with as well for open webOS, maybe you could just abuse the normal browser to do as you wish and repackage it.

72ka 01/08/2013 09:37 AM

Yes, I know Zite, but I have not a TouchPad... For pure webOS phone users doesn't exist similar app... Now I'm sitting in a bus and reading news in my new app for the first time, funny :)

[i]-- Sent from my Palm Pre3 using [url=http://developer.palm.com/appredirect/?packageid=com.newnessdevelopments.forums]Forums[/url][/i]

kkalogia 01/08/2013 10:32 AM

I really like this concept. It would be good to achieve minimum data usage and anything you learn in the process is of value since a good browser is still missing for webos. If by any chance you can achieve an increase in performance/speed then it's even better. I'll keep my eye out for this one. It's good to have aboard 72ka.

geekpeter 01/08/2013 10:49 AM

[QUOTE=72ka;3372249]Yes, I know Zite, but I have not a TouchPad... For pure webOS phone users doesn't exist similar app... Now I'm sitting in a bus and reading news in my new app for the first time, funny :)

[i]-- Sent from my Palm Pre3 using [url=http://developer.palm.com/appredirect/?packageid=com.newnessdevelopments.forums]Forums[/url][/i][/QUOTE]

yeah i think the only reader i have for the pre3 is the bbc app, would be nice to have more like this.

PrplHaz4 01/08/2013 10:12 PM

haha nice job...I just started a similar project too - but instead I'm consuming news feeds from newsblur. Its 100% catered to my requirements, and I use it for pretty much all of my news these days

I like the idea of focusing on feed comments - this in itself is a great problem to solve. Scraping google mobile is a clever idea too. Thankfully for me newsblur feeds are mostly pre-scrubbed html.

best of luck on the app!

72ka 01/09/2013 07:00 AM

Hi, I added more inteligence to the app - forward and backward button - pages are in cache, super fast switching, the every page store the scroller position, and finally, the easy accesible buttons for text size change on the fly.

Try it... but be careful, it is very early and contains many dirty code :)

At this time... I stopped it in Enyo 1 and trying to port to Enyo 2, partially is done, but it is very limited on webOS phone, but I hope it could be usable and then possible to run in openWebOS.

Just download here: [URL="http://www.volny.cz/hp2/webos/winner/cz.72ka.winner_0.0.1_all.ipk"]http://www.volny.cz/hp2/webos/winner/cz.72ka.winner_0.0.1_all.ipk[/URL]

jcmarcos 01/09/2013 08:07 AM

Very, very clever! It's amazing that these kind of "compression" services, such as Google's, still exist freely - They are not easy to make or maintain! I'll find time to check your new app soon!

[QUOTE=72ka]I have not a TouchPad[/QUOTE]

Sure, that's why you are building your own webOS tablet, we know... ;)

bigdoby 01/09/2013 08:28 AM

So far I like the app, it's clean and works very fast.
It works on all the major italian news sites but not [url=http://www.repubblica.it]La Repubblica.it - Homepage[/url], it doesn't load anything at all.

kkalogia 01/09/2013 02:30 PM

Just downloaded and played around with it a bit. It works really great and is very fast. Clean and simple. I also loved the fact that it automatically rearranges the pages according to the zoom level. Great reader. Adding gestures and more functionality such as read it later or such will make it even better.

So my understanding is that it just strips away all the unnnecessary stuff such as pictures, banners etc and keeps the text of the article so that it consumes less data. Would you mind explaining a bit in more detail how the whole procees works, preferably in layman's (and why not in developers') terms.

Great job, will definitely keep an eye out for this one.

72ka 01/10/2013 01:14 AM

[QUOTE=kkalogia;3372501]Would you mind explaining a bit in more detail how the whole procees works, preferably in layman's (and why not in developers') terms.[/QUOTE]

OK, need to say, it is not a webview widget. Because webOS is about web, the base of the app is simple space inside scroller, where is rendered HTML as string. The big advantage of this solution is that I can set the font size, etc.., what webview or browser canīt. The disadvantage is that I have to parse the HTML code manually and manually handle the click events.

OK, how it works in steps:

1) using enyo webservice (AJAX request), I just send something like [url]http://www.google.com/gwt/x?u=myurl[/url], where myurl is url from textfield
2) received response as pure HTML code, without scripts etc...
3) using regular expression removed blue google banners from HTML code
4) check if it is multi-page, then load every page, process it and join at the end of previous HTML
5) now i have whole page as HTML string without banners and multiple page navigation
6) render it to scroller and store the scroller position, save the html to an variable

If Iīm browsing back or forward, it is just displayed previous HTML code from variable, OFFLINE, images are stored in browser cache for this time. I plan to store them to database for later use. The most complicated are point 3 and 4, because I have only HTML as string, no DOM elements...

Using this principle, the images are compressed online to around 50% and more, the code is in a few kB without scripts and styles, no need to read again while going back, the data requirements are so much lower, thus very fast on mobile connection.

72ka 01/10/2013 01:22 AM

Enyo 2
 
1 Attachment(s)
Hi, as I sad.. yesterday i tried to port it to Enyo 2. I was succesfull, sometimes made me angry, but it works, on my Pre3 too - is there any other app in Enyo 2 for webOS phones?? :)

Enyo 2 port:

advantages: actual framework, multiplatform, modern, it have scrollbar in scroller
disadvantages: not designed for webOS, canīt handle webOS phone events (orientation change), etc....

The question is... which way??? Enyo 1 or Enyo 2?

I decided to continue in Enyo2, because of openWebOS and multiplatform availability. Iīll see the next issues... but is a challenge :)

And is very nice to see Enyo 2 app on my Pre3... some piece of the newest code is neat :)

You can see it in screenshot, forget UI... it is only working preview.

jcmarcos 01/10/2013 01:24 AM

[QUOTE=72ka;3372548]The disadvantage is that I have to parse the HTML code manually and manually handle the click events.[/QUOTE]

Wow! Does webOS provide any helper functions for this nightmare?

[quote]is there any other app in Enyo 2 for webOS phones?[/quote]

I don't think so! Jan is here with yet another world premiere!

[quote]not designed for webOS[/quote]

Please ellaborate?

[quote]canīt handle webOS phone events (orientation change), etc[/quote]

So there's still a lot missing in Enyo 2. How can it be that it's been released to the public, while at the same time is missing things that the old Mojo has had for ages?

Herrie 01/10/2013 04:15 AM

[QUOTE=72ka;3372549]Hi, as I sad.. yesterday i tried to port it to Enyo 2. I was succesfull, sometimes made me angry, but it works, on my Pre3 too - is there any other app in Enyo 2 for webOS phones?? :)

Enyo 2 port:

advantages: actual framework, multiplatform, modern, it have scrollbar in scroller
disadvantages: not designed for webOS, canīt handle webOS phone events (orientation change), etc....

The question is... which way??? Enyo 1 or Enyo 2?

I decided to continue in Enyo2, because of openWebOS and multiplatform availability. Iīll see the next issues... but is a challenge :)

And is very nice to see Enyo 2 app on my Pre3... some piece of the newest code is neat :)

You can see it in screenshot, forget UI... it is only working preview.[/QUOTE]
Hi Jan,

Great work as always! Will you put this on Github again too?

For rotation and other API stuff you might want to look into using Enyo2 in combination with PhoneGap/Cordova. It should allow you to get the rotation etc working :)

See [url=http://blog.openwebosproject.org/]The Open webOS Project Blog[/url] for some guidance on this :)

Any chance you'll port your Google Maps to Enyo2 sometime too? I believe most of your code would be re-usable anyway, since Enyo2 is mainly the layout stuff ;)

Firepower 01/10/2013 06:51 PM

This is a great app, tried a few site, works well, like how it opens up new heading into article , and then press back arrow takes you back to the list at exact same spot.

It need to be able to bookmark your favourite sites, maybe show them on home page.
can you add half swip gesture for forward and back arrows.

72ka 01/12/2013 09:29 AM

[QUOTE=Herrie;3372559]Hi Jan,

Great work as always! Will you put this on Github again too?

For rotation and other API stuff you might want to look into using Enyo2 in combination with PhoneGap/Cordova. It should allow you to get the rotation etc working :)

See [url=http://blog.openwebosproject.org/]The Open webOS Project Blog[/url] for some guidance on this :)

Any chance you'll port your Google Maps to Enyo2 sometime too? I believe most of your code would be re-usable anyway, since Enyo2 is mainly the layout stuff ;)[/QUOTE]

Hi, thanks, it really helped me. At this time orientation change now works, backswipe too and other webos features using webos compatibility libs.

My wInNeR Enyo 2 port is almost done, fixed all the UI issues. I have troubles with ajax calls, where request are always doubled, with the same response handler as in Enyo 1 version...
As i said in google maps thread, wInNeR Enyo 2 works on all my accesible platforms - webOS 1.x, 2.x, 3.x, Debian Linux, Windows XP, Android 4.0 as well and this makes me happy!
Thus, I really consider to port my Google maps to Enyo 2, because if it can work on all webOS phones, it meets the main objectives (using webos compatibility libs I can acces the Mojo funbctions and magic). I can be active again in phoenix map apps where I was at begining or just start a new fork focused to webOS and openwebOS. I'll see, but the next checkpoint is still to release stable google maps Mojo release with the new smooth map moving...

Sent from ICOO D70GT tablet

gizmo21 01/12/2013 10:45 AM

As phones SYM-keys do not work in any ENYO apps and we have a simple hack solution for ENYO1, could you perhaps check the code for ENYO2? It is 90% working just the textfield filling fails:
symenyo.js is there and just needs to be linked in index.html


[2013-01-12 16:22:00] (LunaSysMgr) user.crit: org.webosports.app.memos: Uncaught ReferenceError: Mojo is not defined, :1

I'm sure Jan you can fix this :)

- [url]http://forums.webosnation.com/webos-patches/308804-patch-request-enable-sym-key-enyo-webos-3-x.html#post3371702[/url]

[B][Update][/B] pcworld already made a version for enyo2 so now you can use it directly in your new enyo based apps :D

gizmo21 01/12/2013 12:27 PM

opps i just saw the download version 001 still in enyo1. So the SYM works with the symenyo.js :)
No need for sym in this app exactly :) but will be for maps...

[img]http://img2.uplood.fr/freepalm/pt9v_from_my_palm_pre3_winner_2013-12-01_192342.png[/img]

72ka 01/16/2013 06:05 AM

Hi, against all strange issues I finally [B]completed the first Enyo 2 version[/B] of this app.

Just to write some findings about Enyo 2 on phones:
- the AJAX call was doubled, because the call is fired on onchange event. It tooks me two days to find, that the onchange event is fired too on lose or blur focus and If I press enter on field and it loses focus, the event was fired two times.... this behavior is not in Mojo or Enyo 1
- the layout is the same, but withou Flexbox in Enyo 1 is a quite hard/different to do the same

New features of this Enyo 2 port:
- just type to write and URL and Enter to Go
- the URL field contains and clicked link name - usually an article name
- if you focus the URL filed, you can select the URL of the site

AND the best feature, what I always wanted is, if I click the link (usually article name), then in the new page (article page) is looking for the same article name, and if it is found, the scroller automatically scroll to the article. Very usefull if you are browsing some very long page (long header) and each new page contains the same header...

Known issues:
- the scroller performance in Enyo 2 with enyo-unselecatble class is very poor, but with default enyo-selectable class is very annoying that the text is always selected when you touch the scroller


Just try it from here:
[B][COLOR="Magenta"]DOWNLOAD: [/COLOR][/B][URL="http://www.volny.cz/hp2/webos/winner/cz.72ka.winner_0.0.2_all.ipk"]http://www.volny.cz/hp2/webos/winner/cz.72ka.winner_0.0.2_all.ipk[/URL]

I think that the next version could be ready for submit to Preware

[IMG]http://www.volny.cz/hp2/webos/winner/winnerE2_1.PNG[/IMG]

kevets 01/16/2013 09:30 AM

Very nice! Tried it out on a couple of sites and it definitely does a fine job stripping the site down to the content. Keep up the good work! Being able to bookmark sites for quick access would be a nice plus. Heck, it'd be great to have a contextual link patched into the web browser so if I come across a link to a story I want to read in your app it can launch it straight into it. Just coming up with ideas.

Also want to thank you for the superb Google Maps app. I don't know how you do it, but on the Pre3 with GPS turned on, it's pretty darn accurate! I love it.


All times are GMT -5. The time now is 07:39 PM.



Content Relevant URLs by vBSEO 3.6.0