Re: newbie wants some help

41 views
Skip to first unread message

Jeremy Geerdes

unread,
Aug 26, 2012, 7:27:17 AM8/26/12
to google-ajax...@googlegroups.com
It's tough to offer suggestions without seeing exactly what's on your page right now. Could you provide a link to the page that you have set up, whether it is working or not?

That said, if you're wanting to get enclosure information, it's probably safe to assume that you'll need to write your own control to display the feeds. The JQuery plug-in you linked appears to utilize the standard Google Feeds Control, which won't look for enclosure elements. You'll need to pull the feed in mixed format and then search the results' xml for the appropriate enclosure element(s). Then you'll need to create your own HTML node for the result and display it on the page.

Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

For more information or a project quote:

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

On Aug 24, 2012, at 3:56 PM, sak wrote:

Hi,
I have pulled a feed from a website and displayed it successfully on my website using gfeed and http://www.malsup.com/jquery/gfeed/
Please tell me how to edit the results as now it only shows the <title> and <pubDate>.
How to add the <description> and <enclosure> etc as well?
Thanks in advance.

--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msg/google-ajax-search-api/-/lr-1lriG0tQJ
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

sak

unread,
Aug 27, 2012, 5:34:56 PM8/27/12
to google-ajax...@googlegroups.com
Hi everyone,
jgeerdes,thanks for your reply.You can see my code below(Jsfiddle demo).I was able to get the enclosure and other tags by changing the format to xml.Thanks a lot.

I have displayed rss feed in a website using google feed api.Please have a look at the code here:Jsfiddle demo

You can see that there are two simple divs.In the start of javascript code,I wrote the code for google feed plugin and then there is the code for appending some elements in feeds div. Now,its showing 12 entries.But I want have two buttons which show the next 12 entries and so on(question 1).

When an element is clicked in div#feeds,it should show the results in div#feeds-2 for which I have wrote the code in the display function.(question 2)

Winding up,my questions are: 1.How to show the next 12 entries in the rss feed?as the feed has almost 100 items.

2.When clicked on any of the item in div#feeds,the results displayed in the div#feeds-2 belong to the 9th entry.However,I want it to display the result of the element clicked.

3.I have linked the video having .wmv format but its not playing the video in jwplayer.Can somebody please give me some other plugin?I also used google media but it displayed a link,when clicked,played the video in windows media player.I want it to play in the website.

For very long time,I've been working on this but didn't got my required results.So need help from you guys,thanks in advance.

Jeremy Geerdes

unread,
Aug 27, 2012, 6:07:13 PM8/27/12
to google-ajax...@googlegroups.com
To answer your questions:

1: Since the Feeds API does not support paging, you'll need to request as many items as you eventually want to display in the first request, and you'll be subject to the limit of entries that the API will return. You can still simulate the paging that you want by only displaying 12 at a time, but you'll need to actually get all the results up front.

2: The issue that you're having here is symptomatic of the loop that you're using. Specifically, you are re-declaring the display function in each iteration of the loop. So when the loop is done, they all act like you're clicking on the last entry. The solution is to pull the display function out of your loop and use what's called a method closure to build your onclick handler. A method closure is basically a function that returns a function. So in this case, a good closure for you would look like:

function myClosure(item){
  return function(){
    // display entry's video
  }
}

Then your box.onclick = function(){ display(); } line would look like this:

box.onclick = myClosure(item);

3: Well, with WMV, you're always going to have someone who can't watch your video without jumping through a few hoops. If I was doing it and had control of the videos, I would transcode the videos into H.264 and WebM or Ogg and then build my own player with a little HTML5. Otherwise, I don't know what to suggest if JWPlayer won't play it for you.


Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

For more information or a project quote:

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
Reply all
Reply to author
Forward
0 new messages