Rss reader in app android

I read rss :

<script type="text/javascript">

google.load("feeds", "1");

function initialize() {
  var feed = new google.feeds.Feed("http://www.maratondesantiago.com/feed/");
  feed.load(function(result) {
    if (!result.error) {
      var container = document.getElementById("feed");
      for (var i = 0; i < result.feed.entries.length; i++) {
        var entry = result.feed.entries[i];
        //console.log(entry);
        var div = document.createElement("div");
        var p = document.createElement("p");
        var title = document.createTextNode(entry.title);
        var imagenes = entry.content.match(/http([^">]+)/g);
        console.log(imagenes[i]);
        p.appendChild(title);
        p.style.marginTop = "70px";
        p.style.marginLeft = "15px";
        p.style.color = "black";
        div.style.width = "100%";
        div.style.height = "100px";
        if(imagenes[i]!=null){
          var str = imagenes[i];
          div.style.backgroundImage = "url("+imagenes[i]+")";
          div.style.backgroundRepeat="repeat-y";
          div.style.backgroundSize="100% 80px"
        }else{
          div.style.background = "red";
        }
        div.style.color = "white";
        div.style.border="thick solid #FFF";
        div.appendChild(p);
        container.appendChild(div);
      }
      var count = $("#feed div").children().length;
      document.getElementById("noticias").innerHTML = count;
    }
  });
}
google.setOnLoadCallback(initialize);

If the user opens the section “News”, the notification is cleared with numbers, but if the news is updated, update the news forever in numbers, It is possible?

Thanks!

While this is more geared towards plain angular apps, it should get you in the right direction for what you need.

http://dailyjs.com/2013/04/25/angularjs-3/

1 Like