Coder Social home page Coder Social logo

wowfunhappy / pebble-rss-reader Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 1.0 2.35 MB

A full-text RSS Reader for the Pebble Smartwatch

License: GNU General Public License v3.0

JavaScript 51.88% C 44.28% Python 2.02% C++ 1.83%
hacktoberfest pebble-smartwatch pebble

pebble-rss-reader's Introduction

Banner

Hands full? No problem! As long as you have a Pebble smartwatch and at least one free finger, you can read the news—no pulling out your phone required.

Pebble RSS Reader is the only way to read complete news articles, blog posts, or anything else with an RSS feed on your Pebble smartwatch. An unlimited number of feeds are supported, as are articles of any length. Peruse the default feeds, or add your own in Settings.

Download Now From The Appstore!


This is a PebbleJS project, so most of the code specific to this app can be found in app.js. Feel free to ask me questions about how I did anything. If you want to reuse any code, please do note that it's licensed under the GPL (v3 or later). If this license is somehow preventing you from making something awesome, get in touch and we'll work it out.

The issue tracker contains a bunch of "wish list" items which I don't expect I'll ever get around to myself. Help with any of them would be greatly appreciated.

Lots of thanks to:

  • Cralex (testing)
  • Molayl (rss2json api)
  • Rebble Team

...and every website that offers full-text RSS feeds

pebble-rss-reader's People

Contributors

cennoxx avatar willatibm avatar willow-systems avatar wowfunhappy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

willow-systems

pebble-rss-reader's Issues

Amount of text per page

I'm currently using a conservative limit of 80 characters per page (plus or minus some for special conditions), but this isn't great in all situations, due to variable character widths and line wrapping.

Is there a better way?

White screen on OG Steel

Tried installing it on my OG steel connected to my iPhone. It replaced SimplyJS and tried to load on my watch, but it only displayed a white screen on my watch after it finished transferring. I tried deleting it and reinstalling it and the same thing happens. Trying to open the app settings will cause the app to try loading, but it still gets stuck on the white screen and the settings page on the phone never loads.

This seems similar to the behavior of an in-development google assistant app that was uploaded to the Rebble Discord. I remember someone saying something about the iPhone’s JS engine working differently? I can try testing other watches or on an android phone to rule out problems.

In the meantime, let me know if there’s anything you want me to try.

Remove dependency on rss2json api

This app currently relies on the rss2json api for xml parsing. While it's an excellent service—and I'm grateful to its developer, Molayli, for providing it—I don't like depending on an external API. Who can say how long it will be available?

Below is an alternate version of the getArticles() function I wrote earlier in development, which doesn't use an API. It largely worked, but couldn't handle a lot of edge cases, and had issues with performance and text encoding.

Could it be made more robust? If even just the text encoding issue could be resolved, that alone would be a great start. For an example of the text encoding problem, try loading a headline from the New York Times's RSS feed and watch what happens to most non-ASCII characters, such as .

(Note: This function was written a long time ago, and so some function definitions likely need to be updated to work with the latest version of the code. This should be trivial, but if not, let me know.)

	function getArticles() {
		loadingCard = new UI.Card(blackStatusBar);
		loadingCard.title(" ");
		loadingCard.subtitle(" ");
		loadingCard.body("        Loading...");
		loadingCard.show();
		articleList = [];
	
		xhr = new XMLHttpRequest();
		// xhr.responseType = "document"
		// xhr.overrideMimeType("text/html; charset=ISO-8859-1");
		// xhr.setRequestHeader("Accept-Charset", "ISO-8859-1");
		xhr.open('GET', currFeed.url);
		// xhr.overrideMimeType('text/xml; charset=iso-8859-1');
		xhr.onload = function() {
	
			articleList = [];
	
			items = xhr.response.match(/<item>([\s\S]*?)<\/item>|<entry>([\s\S]*?)<\/entry>/g);
			for (itemNum = 0; itemNum < items.length; itemNum++) {
				article = {};
	
				title = items[itemNum].match(/<title>([\s\S]*?)<\/title>/);
				if (title) {
			    	article.title = formatText(title[1]);
			  	}
	
				author = items[itemNum].match(/(<author>|<dc:creator>)([\s\S]*?)(<\/author>|<\/dc:creator>)/);
				if (author) {
					article.author = formatText(author[2]);
				}
	
				content = items[itemNum].match(/<content.*?>([\s\S]*?)<\/content.*?>/);
				if (content) {
					article.pages = makePages(content[1]);
				}
				else {
					article.pages = makePages(items[itemNum].match(/<description.*?>([\s\S]*?)<\/description.*?>/)[1]);
				}
	
			 	articleList.push(article);
			 	if (articleList.length === items.length) {
					loadingCard.hide();
					selectArticle(articleList);
				}
			}
		};
		xhr.send();
	} 

Save and restore the current article/page when the app is exited and relaunched.

This is the next feature I am going to add.

When the user opens an article, all pages are to be saved to local storage. When the user advances a page, the current page gets saved as well.

Exiting a restored article will take the user back to the list of feeds, because we're not saving the full article list to local storage, just the current article. I don't want users browsing outdated news.

Sometimes articles aren't restored, in situations when they should be restored.

If the last screen before the user exited the app was an article page, that page should always get get restored when the app is re-opened. (In other cases—if the last screen was the feed selection menu or the article selection menu—nothing should get restored.)

Sometimes, articles are not getting restored even when the last screen was an article page. I haven't figured out how to reliably reproduce this yet.

Need to fix this before 2.0 + app store release.

Add OPML Support

This is probably more helpful when testing updates, but I’d like the ability to save my feeds to a file that I can download to my phone, and then upload later if needed. (Can pebble app settings do that? Maybe a window showing a block of text that could be copied from, hidden behind a debug or developer option would suffice.)

Settings: Drag and drop to reorder feeds?

Right now, there's no easy way to change the position of an existing feed in the Settings menu. If you add a feed, it gets added to the end of the existing list, and if you remove a feed, the last in the list gets removed. You can't add to the middle.

I'd love to allow users to drag and drop feeds to re-order them. This would be trivial with jQuery UI, but pulling in JQuery for such a tiny 3kb page bothers me. So, I would need a native drag and drop implementation...

Show instructions when app is opened for the first time.

Y'know how nowadays whenever you open a new mobile app for the first time, it displays a welcome tour?

Yeah, I hate those too. Time to add one to my own app!

It's needed, or users will never discover that they can long press select to return to the list of articles.

stuck in "Loading.." when opening rss feed

Hi,

congratulations to your app, it`s great, especially to read full texts which was not possible with other apps. I found an issue with one feed, the app remains in "Loading.." state for minutes (probably forever) when trying to open it. Could it be that the feed url breaks the parser due to the %5B and %5D chars ("[" and "]") in the url? Or could it be related to the response? the response is the menu plan of a college dining hall possibly containing umlauts like ä,ü,ö,ß.

https://www.akafoe.de/gastronomie/speiseplaene-der-mensen/bistro-der-ruhr-universitaet-bochum/?mid=37&tx_akafoespeiseplan_mensadetails%5Baction%5D=feed&tx_akafoespeiseplan_mensadetails%5Bcontroller%5D=RSSFeed&cHash=00668abfcb211d080183ffcf28623873

Thank you and best regards,
Stefan

Standalone app?

I can't seem to get Javascript apps working in the official SDK, which is why I used SimplyJS. But, I'd love to make this into a proper app so people don't have to create gists and such.

In list of articles, title of highlighted article should autoscroll, so user can see full headline.

In the list of articles, nearly every headline is too long and gets cut off. To mitigate this, the title of the currently-highlighted article should automatically scroll left-to-right, a la an old-school marquee tag.

This would need to be done in C.

Evernote's Pebble app had this functionality, and its developer shared the code in a blog post. https://damian.fyi/2015/01/22/scroll_pebble_menus/. It should be relatively easy to reuse this implementation.

Menu Highlight Color

tombolger on reddit pointed out I should probably use a highlight color other than black for menus, on Pebbles that have color screens. I want to use two colors: one for the feed select menu, and one for the article select menu.

The code for this is dead simple. The hard part will be choosing a color, because I'm invariably going to obsess over which one is best for much too long.

Feel free to suggest colors in this thread (as in exact shades).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.