Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • maanehunden 61 posts 105 karma points
    Sep 06, 2010 @ 18:43
    maanehunden
    0

    reading rss feed from picasaweb.. ??

     

     

    Hello fellow developers..

    I am trying to grab an image gallery feed from picasaweb.. for my webpage,.. I've allready made a Wordpress fread reader http://laikaslair.dk/developer.aspx, but this picasa gallery feed is pulling my teath ,.. 

    Her is a link to the feed,..
    http://picasaweb.google.com/data/feed/base/user/101138924987420528379 ;

    And her's how i've implemented my reader 

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYpE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
        version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
        exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
     
     
    <xsl:output method="xml" omit-xml-declaration="yes"/>
     
    <xsl:param name="currentpage"/>
     
    <xsl:template match="/">
     
      <!-- cache for  1.800 seconds(30min) -->
      <xsl:variable name="cacheRate" select="number(1800)"/>
     
      <xsl:variable name="picasaFeedUrl" >
        <!--find the main feed url-->http://picasaweb.google.com/data/feed/base/user/101138924987420528379
      </xsl:variable>
     
      <xsl:variable name="feedContentXML" select="umbraco.library:GetXmlDocumentByUrl($picasaFeedUrl, number($cacheRate))"/>
     
      <xsl:copy-of select="count($feedContentXML//entry)"/>
     
    </xsl:template>
     
    </xsl:stylesheet>
    
    

    In my mind the   "<xsl:copy-of select="count($feedContentXML//entry)"/>" code should render number 3 but the only thing i'm getting is 0. 

    and <xsl:copy-of select="$feedContentXML"/> renders the whole feed,.. ass it should

    There's something i am missing.. )c:, 

    Suggestions plz..

  • maanehunden 61 posts 105 karma points
    Sep 06, 2010 @ 21:32
    maanehunden
    0

    Ok.little bit progress here,.. i've noticed that the picase feed is not a RSS feed but an Atom feed,..  that could explain why i cant' parse it like I've done many times before.. .. Have anyone parsed this kind of format with XSLT,.. ?

     

  • Hendrik Jan 71 posts 137 karma points
    Sep 06, 2010 @ 22:20
    Hendrik Jan
    0

     

    Wel ofcourse you need to include the atom namespace etc..

     

    This link might be usefull to you

    http://snippets.dzone.com/posts/show/1162

  • maanehunden 61 posts 105 karma points
    Sep 06, 2010 @ 23:13
    maanehunden
    0

    i did exactly that and added this to the top og my code 

     xmlns:atom="http://www.w3.org/2005/Atom/"
     xmlns:media="http://search.yahoo.com/mrss/"

    thanks

    But the feed is till fighting back (c:

    when i am probing for a special link item like this,..

    <xsl:value-of select="./atom:link[@rel = 'alternate']"/>

    i am getting Zilch but i can see there is at least three  links in an entry 
    <xsl:value-of select="count(./atom:link)"/>

    weired,..

  • Hendrik Jan 71 posts 137 karma points
    Sep 07, 2010 @ 06:28
    Hendrik Jan
    0

    if u want us to help you need to give some example code. Also the link to xml doesnt work.

    But,i guess your code is something like this right?

    <xsl:for-each select="./atom:link[@rel = 'alternate']">

      <xsl:value-of select="."/>

    </xsl:for-each>


     

     

     

  • maanehunden 61 posts 105 karma points
    Sep 07, 2010 @ 19:44
    maanehunden
    0

    sorry i was a bit tired at that moment ..

      <xsl:for-each select="$feedContentXML//atom:entry">
        <xsl:copy-of select="count(./atom:link)"/>
        [<xsl:copy-of select="./atom:link[@rel = 'alternate']"/>]
        <xsl:copy-of select="count(./atom:link[@rel = 'alternate'])"/>
      </xsl:for-each>

    where $feedContentXML holds the feed.. the wired thing is that <xsl:copy-of select="count(./atom:link)"/> gives number 3,
    where as [<xsl:copy-of select="./atom:link[@rel = 'alternate']"/>] is somehow results in emty result(i've checked the feed there is an url in there).. and finally <xsl:copy-of select="count(./atom:link[@rel = 'alternate'])"/> gives a predictable 1..


     

     

  • maanehunden 61 posts 105 karma points
    Sep 07, 2010 @ 22:26
    maanehunden
    0

    hi all,..
    this seems to do the trick..

      <xsl:for-each select="$feedContentXML//atom:entry/atom:link[@rel = 'alternate']">
        <xsl:value-of select="@href"/>
      </xsl:for-each>
    

    it returns all the expected Url's .. 
    thanx for all the help ,.. (c: 

    and happy coding.. 

Please Sign in or register to post replies

Write your reply to:

Draft