Hi Hertz,

It looks like the reason that the title and other information is being
duplicated in the excerpt is because that is what is present in the actual
RSS for this feed. If you look at the raw feed, you'll see that the content
HTML contains this information and the draw method strips out the non-human
readable HTML tags and presents the text. If you wanted to just render the
HTML from the feed (which might look more like what you want) you could do
something like the following

// Our callback function, for when a feed is loaded.
function feedLoaded(result) {
  if (!result.error) {
    // Grab the container we will put the results into
    var container = document.getElementById("content");
    container.innerHTML = '';

    // Loop through the feeds, putting the titles onto the page.
    // Check out the result object for a list of properties returned in each
entry.
    //
http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON
    for (var i = 0; i < result.feed.entries.length; i++) {
      var entry = result.feed.entries[i];
      var div = document.createElement("div");
      div.innerHTML = entry.content;
      //div.appendChild(document.createTextNode(entry.content));
      container.appendChild(div);
    }
  }
}

function OnLoad() {
  // Create a feed instance that will grab Digg's feed.
  var feed = new google.feeds.Feed("
http://news.google.com/news?pz=1&ned=usa&hl=en&q=casino&num=20&output=rss";);

  // Calling load sends the request off.  It requires a callback function.
  feed.load(feedLoaded);
}

google.setOnLoadCallback(OnLoad);

Just an idea, not sure if this is exactly what you are looking for.

Thank you,

Jeff

On Tue, Jul 28, 2009 at 10:07 AM, Hertz <[email protected]> wrote:

>
> Hello,
>
> I have a newsfeed that I've been able to customize it to the way I
> want.  The only problem is that it repeats the title, article, and
> news article in where the article area is supposed to be.  I want it
> so it goes in this format only -
>
>
> <link to headline>Headline Title</link to headline>
> Article excerpt 1-2 lines
>
> I just can't seem to figure out where exactly to customize it to I
> want.  The link to a working example of what I have so far so you can
> see my problem is located here http://nesanika.com/newsfeed.html -
> Here is the script I have:
>
>        <script type="text/javascript">
>
>    google.load("feeds", "1");
>
>    function OnLoad() {
>      var feedControl = new google.feeds.FeedControl();
>          feedControl.setNumEntries(20);
>
>      feedControl.addFeed("http://news.google.com/news?
> pz=1&ned=usa&hl=en&q=casino&num=20&output=rss<http://news.google.com/news?%0Apz=1&ned=usa&hl=en&q=casino&num=20&output=rss>
> ");
>
>      feedControl.draw(document.getElementById("content"));
>    }
>
>    google.setOnLoadCallback(OnLoad);
>    </script>
>
>  <body style="font-family: Arial;border: 0 none;">
>    <div id="content">Loading...</div>
>  </div>
>
> Any assistance would be highly appreciated.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-AJAX-Search-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to