Rss feed is working except for when there's a php link? Options
wolfestone
Posted: Thursday, November 20, 2008 12:19:23 AM
Rank: Enthusiast

Joined: 11/4/2008
Posts: 48
Location: US
I have been playing around with an RSS feed and got it working.

I am now trying to experiment with getting it to display facebook status but it's not displaying anything. The facebook status feed link is in this format:

http://www.new.facebook.com/feeds/status.php?id=0000000000&viewer=0000000000&key=2e16e23222&format=rss20

(edited the id and viewer to all zeros)

and so I'm guessing this is where my problem is - since it's not pointing directly to an XML file. I tried running the link through tinyurl but that didn't help either.

Is there any way around this?


drobar
Posted: Thursday, November 20, 2008 1:43:49 AM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Shouldn't be a problem consuming the facebook feed as long as the output really is in xml format. It doesn't matter what the url is.

This is a nice macro and discussion on getting external feeds into your umbraco site. Might be useful to you. http://dawoe.blogspot.com/2008/03/transforming-feedsone-xslt-to-rule-them.html

cheers,
doug.

MVP 2007-2009 - Percipient Studios
wolfestone
Posted: Thursday, November 20, 2008 4:36:37 PM
Rank: Enthusiast

Joined: 11/4/2008
Posts: 48
Location: US
Thanks for the link, I've tried to modify that for umbraco but I haven't had much luck passing it the url. Hopefully I can get someone with more xml/xslt knowledge than me to look at it.

The facebook RSS feed does appear to be in xml format from what I can tell?:

Code:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
    <channel>
        <title>NAME Facebook Status Updates</title>
        <link>http://www.new.facebook.com/minifeed.php?status&amp;id=000000000</link>
        <description>NAME&apos;s Facebook Status Updates</description>
        <language>en-us</language>
        <category domain="Facebook">StatusSyndicationFeed</category>
        <generator>Facebook Syndication</generator>
        <!-- SUDA was here.  10.18.109.130 -->
        <docs>http://www.rssboard.org/rss-specification</docs>
        <lastBuildDate>Mon, 17 Nov 2008 19:04:07 -0500</lastBuildDate>
        <webMaster>webmaster@facebook.com</webMaster>

        <item>
            <guid>http://www.new.facebook.com/profile.php?id=00000000&amp;story_fbid=000000000000000</guid>
            <title>NAME is status message</title>
            <link>http://www.new.facebook.com/profile.php?id=00000000&amp;story_fbid=00000000</link>
            <description></description>
            <pubDate>Mon, 17 Nov 2008 19:04:07 -0500</pubDate>
            <author>Author Name</author>
        </item>
drobar
Posted: Thursday, November 20, 2008 5:23:09 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
How'd you modify the xslt?

I haven't done it myself, but I think you'd want to make a variable for the url to your feed, and then get the feed's xml output.

<xsl:variable name="FaceBookFeed" select="umbraco.library:GetXmlDocumentByUrl($FaceBookFeedUrl)"/>

Once you've done that you can check that it got the right values with <xsl:copy-of select="FaceBookFeed"/>

Notice that it's a 'copy-of'. You'll need to view the html source in your browser to see the output since the browser won't known how to render the raw xml.

Once getting the xml feed works it should be quite simple to parse it and display the parts you want. But let's start with the first thing first :)

cheers
doug.

MVP 2007-2009 - Percipient Studios
wolfestone
Posted: Thursday, November 20, 2008 10:18:08 PM
Rank: Enthusiast

Joined: 11/4/2008
Posts: 48
Location: US
Thanks Doug,

I am now getting an error: here's the first part of my XSL (I added some namespaces I believe are required - per the RSS feed I have that works)

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:atom3="http://purl.org/atom/ns#"
    xmlns:rss="http://purl.org/rss/1.0/"
    xmlns:rss09="http://my.netscape.com/rdf/simple/0.9/"   
    xmlns:media="http://search.yahoo.com/mrss/"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="xsl rdf dc rss rss09 atom atom3 msxml umbraco.library media"
>
<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:variable name="url" select="/macro/url" />
<xsl:variable name="facebookFeed" select="umbraco.library:GetXmlDocumentByUrl($url)" />



here's the error I am getting, and it goes away if I remove the second line declaring flickrxml:

System.UriFormatException: Invalid URI: The URI is empty.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Net.WebRequest.Create(String requestUriString)
at umbraco.library.GetXmlDocumentByUrl(String Url) in d:\inetpub\wwwroot\ccnet\Source\Umbraco 4\umbraco\presentation\library.cs:line 1532


From my limited understanding, it looks like the error occurs because there's no url yet (the macro hasn't passed it one). If that's what's going on, how can I get around this?

Thank you for the help!
PeterD
Posted: Thursday, November 20, 2008 10:30:32 PM

Rank: Addict

Joined: 7/20/2006
Posts: 573
Location: NL
How do you call your macro? Is the url passed to it? Note that the parameters are case sensitive.

HTH,
PeterD

Check out the calendar with recurrence at my blog.
wolfestone
Posted: Thursday, November 20, 2008 10:43:14 PM
Rank: Enthusiast

Joined: 11/4/2008
Posts: 48
Location: US
I'm inserting the macro in a content page, via the rich text editor macro button.

The macro has one parameter (url). I should be referencing it by it's alias, correct? it's alias is url, it's name is Url.

I found a walkthrough for doing this with RSS Feeds, and I got it working for basic ones (BBC news, ESPN.com). It doesn't work for the facebook feed though, and it did some weird formatting with one from MSNBC which contained CDATA tags.

If I can get the example doug linked earlier working in the same way under umbraco, that would be even better since it looks like it can handle all kinds of feeds.

Thanks very much!

drobar
Posted: Thursday, November 20, 2008 11:14:10 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Just noticed from your error message that you're running umbraco 4 beta. I wonder if we're on the tracks of a bug?

If you are comfortable with it, can you contact me through my website and send me the url for your facebook feed? I'd like to try it on an umbraco 3 and an umbraco 4 beta2 build to see if there's a difference.

cheers,
doug.

MVP 2007-2009 - Percipient Studios
wolfestone
Posted: Friday, November 21, 2008 3:21:57 PM
Rank: Enthusiast

Joined: 11/4/2008
Posts: 48
Location: US
In the hopes of saving you some trouble, I tried it on my umbraco 3 install and had the same problem (used my original RSS feed module, which displayed the BBC news website feed fine, but didn't show anything for facebook).

I managed to get rid of the error by moving the variable part inside the xsl:if statement - the statement in the code I copied checks whether the url is != an empty string, if it is, it populates it from the macro. I still haven't got any data from the facebook feed though.

(I sent you a message through your site too in case it'd still be helpful).

Thanks
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.