Yet more improvements now RSS works and forms stay in the boxes if
form has class='ajaxform1'. It also enforces all web2py_ajax
constraints in 'integer', 'date' fields, etc.

Massimo

On May 20, 12:16 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> I fixed the RSS. Just for fun. Here is the web2py RSS code:
>
> def rss():
>     import gluon.contrib.feedparser as feedparser
>     d = feedparser.parse(request.vars.q)
>     r = TAG.channel(P(A(d.channel.title,_href=d.channel.link),XML
> (d.channel.description)))
>     [ r.append(TAG.item(P(A(entry.title,_href=entry.link),XML
> (entry.description))))
>       for entry in d.entries]
>     return r.xml()
>
> here is the original equivalent PHP code
>
> <?php
>
> //get the q parameter from URL
> $q=$_GET["q"];//find out which feed was selected
> $xml=urldecode($q);
>
> $xmlDoc = new DOMDocument();
> $xmlDoc->load($xml);
>
> //get elements from "<channel>"
> $channel=$xmlDoc->getElementsByTagName('channel')->item(0);
> $channel_title = 
> $channel->getElementsByTagName('title')->item(0)->childNodes->item(0)->no\
>
> deValue;
> $channel_link = 
> $channel->getElementsByTagName('link')->item(0)->childNodes->item(0)->node\
>
> Value;
> $channel_desc = 
> $channel->getElementsByTagName('description')->item(0)->childNodes->item(0\
>
> )->nodeValue;
>
> //output elements from "<channel>"
> echo("<p><a href='" . $channel_link . "'>" . $channel_title . "</a><br/>");
>
> echo($channel_desc . "</p>");
>
> //get and output "<item>" elements
> foreach ($xmlDoc->getElementsByTagName('item') as $x) {
>         
> $item_title=$x->getElementsByTagName('title')->item(0)->childNodes->item(0)->nodeV\
>
> alue;
>         
> $item_link=$x->getElementsByTagName('link')->item(0)->childNodes->item(0)->nodeVal\
>
> ue;
>         
> $item_desc=$x->getElementsByTagName('description')->item(0)->childNodes->item(0)->\
>
> nodeValue;
>         echo ("<p><a href='" . $item_link . "'>" . $item_title . "</
> a><br/>");
>         echo ($item_desc . "</p>");}
>
> ?>
>
> On May 20, 11:16 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > Yes, I just have not connected, the part that interest me most is
> > containing forms in components.
>
> > On May 20, 11:14 am, Skylar Saveland <skylar.savel...@gmail.com>
> > wrote:
>
> > > >https://www.web2py.com/jpolite
>
> > >https://www.web2py.com/jpolite/default/main#t7
>
> > > The RSS readers to not work for me.  I suppose that we are aware of
> > > this?
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to