Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 123

jlescribanoc
Aspiring developer
Profile
Posts: 25
Reg: Aug 12, 2012
VALLADOLID, SPA...
6,500
09/09/12 01:43 AM (13 years ago)

Plugin suggestion ... RSS reader plugin

Hi! I thing will be a good plugin ... Think about ... ;-)
 
Ledbelly2142
Aspiring developer
Profile
Posts: 80
Reg: Aug 04, 2012
Reno
6,750
like
09/09/12 08:07 PM (13 years ago)
I think it would be a good plugin too. -Led
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/09/12 08:19 PM (13 years ago)
great suggesiton - I have a mobile html page setup to accomplish this, but a more native option would be preferable.
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
09/16/12 02:11 PM (13 years ago)
Do you mind sharing your html page code?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/16/12 03:12 PM (13 years ago)
Sure - it's an adaptation of the rss reader at http://www.appin8.com/blog-post/mobile-rss-reader-google-feeds-api-jquerymobile-localstorage/ I adapted it to load a specific feed, rather than user input. I'll post code in next post.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/16/12 03:12 PM (13 years ago)
<!DOCTYPE html> <html> <!-- Copyright 2011 Brendan LaMarche http://www.appin8.com Approx 4 Hours License: GPLv3 --> <head> <title>RSS Mobile Reader</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" /> <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="https://www.google.com/jsapi?key=ABQIAAAAuvAXPRXL9qkzO0R8vzYpOhQ_BAnb8hQeSCQ2aBH79hHa1YbW_RQNN9ClKXG21xQObiXJ7diAAYaywg"></script> <script type="text/javascript"> $calendarfeed = "*****INSERT RSS FEED HERE*****"; <!-- //INIT $(document).bind("mobileinit", function(){ $.extend( $.mobile , { defaultTransition: "slide" }); //init local storage feeds if ( typeof localStorage["feeds"] == "undefined") { restoreDefault(); } }); $(document).ready(function(){ //load local storage feeds loadFeed($calendarfeed); }); //FUNCS function loadFeed(url) { var rnd=Math.floor(Math.random()*10000000); $(document.body).append('<div data-role="page" id="results'+rnd+'" data-theme="b">'+$("#results").html()+'</div>'); var feed = new google.feeds.Feed(url); feed.setNumEntries(30); feed.load(function(result) { if (!result.error) { $("#results"+rnd+" .resultscontent").append('<div data-role="controlgroup" class="articlelist"></div>'); for (var i = 0; i < result.feed.entries.length; i++) { $("#results"+rnd+" .resultscontent .articlelist").append('<input data-icon="arrow-r" data-iconpos="right" onclick=\'showArticle("'+escape(result.feed.entries[i].title)+'","'+escape(result.feed.entries[i].link)+'","'+escape(result.feed.entries[i].content)+'")\' type="button" value="' + result.feed.entries[i].title.replace(/"/g, "'") + '" />'); } $("#results"+rnd+" .feedtitle").html("Upcoming Events"); $.mobile.changePage($("#results"+rnd),"slide",false,true); } else alert('feed error'); }); } function showArticle(title, url, desc) { if (typeof desc=="undefined") desc="(No description provided)"; $("#article .articleinfo").html("<p>"+unescape(title)+"</p><p>"+unescape(desc)+"</p><p><a target=\"_blank\" href=\""+unescape(url)+"\">"+unescape(url)+"</a></p>"); $.mobile.changePage("#article","slide",false,true); } function HtmlEncode(html) { return $('<div/>').text(html).html(); } function HtmlDecode(text) { return $('<div/>').html(text).text(); } //google feeds api google.load("feeds", "1"); function OnLoad() {} google.setOnLoadCallback(OnLoad); --> </script> <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script> </head> <body> <div data-role="page" id="main" data-theme="b"> <div data-role="header"><h1>RSS Mobile Reader</h1></div> <div data-role="content"> <div data-role="controlgroup" id="yourfeeds"> </div> <div data-role="controlgroup"> </div> </div> </div> <!-- placeolder for feed template --> <div id="results"> <div data-role="header"><h1 class="feedtitle"></h1></div> <div data-role="content" class="resultscontent"> </div> </div> <!-- placeolder for feed template --> <div data-role="page" id="article" data-theme="b" data-add-back-btn="true"> <div data-role="header"><h1>Details</h1></div> <div data-role="content" class="articleinfo"></div> </div> <div data-role="page" id="addfeed" data-theme="b"> <div data-role="header"><h1>RSS Mobile</h1></div> <div data-role="content"> <div data-role="fieldcontain"> <label for="rssFeed">RSS Feed Url:</label> <input type="text" id="rssFeed" name="rssFeed" value="http://" /> </div> <input type="button" onclick="addTheFeed();" value="Add This Feed" data-iconpos="right" data-icon="check" /> </div> </div> </body> </html>
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/16/12 03:14 PM (13 years ago)
just be sure to set the $calendarfeed variable.
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
09/16/12 05:19 PM (13 years ago)
Thanks!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.