Importing RSS Feed Into FileMaker with XSLT

Update:

Per popular request I am revisiting this article. I made some edits and also now you can download the the demo file.

Someone sent an email to our FileMaker group to request information about importing RSS feed into FileMaker. Since I have done this and it’s actually quite easy, I thought I’d post the method here.

Ingredients

  1. FileMaker (8.5 or later because you need Web Viewer);
  2. A FileMaker database ;
  3. An XSLT style sheet; (I found this style sheet somewhere some time ago; didn’t write it myself)
  4. A web host where you can post the XSLT file;
  5. An RSS feed that actually works with this (e.g. Yahoo Stocks: http://rss.news.yahoo.com/rss/stocks);
  6. A script that pulls the info (which now can be run on server if you have FMS 9 or 10);
  7. A table in your DB for storing the RSS feeds;
  8. A portal on your layout that shows the list of RSS feeds;
  9. A web viewer in your database that can display the resulted web page;
  10. A script that tells the web viewer to show the requested article.

 

Directions

  1. Create a new table called ‘RSS_Feed’ in your solution (since this only works in FM 8.5 and later, there’s no need for a separate file). Create the following fields: ID, Title, Description, Link, PubDate, SelectedLink;
  2. Link the new table to your preferred table (Global, Solution, etc.) by showing all records (‘x’ symbol);
  3. Create a new layout in your solution, place a portal on it showing the records from the RSS Feed table (link and description fields, minimum). Place a web viewer next to it. Name your web viewer object “article”;
  4. Create a script similar to this example to refresh the feed (you can run this script from a button on your layout or at certain intervals from the server):
Go to Layout [ "Layout Name" (Table Name) ] Enter Browse Mode Show All Records Delete All Records [ No dialog ] Import Records [ XML (from http): http://rss.news.yahoo.com/rss/stocks; XSL (from http): http://www.website.com/folder/rss2fmp.xsl ] [ No dialog ] Go to Layout [ original layout ] 
  1. Create a script for showing the article:
 Set Field [ RSS_Feed::SelectedLink; RSS_Feed::Link ] Set Web Viewer [ Object Name: "article"; URL: RSS_Feed::SelectedLink ] 
  1. Turn your title field on your portal into a button and link to perform the script above.

This is most likely not the only method; it may not be the best method either. It is, however a working method.

Any questions, suggestions, feel free to respond.

 

6 replies
    • Agnes Riley
      Agnes Riley says:

      You’re welcome, Rod. This technique should work the same exact way in FM10. The good thing about 10 is that you can actually schedule the import script to run periodically on the server, so your users won’t have to do it.

      Agi

  1. Lauren Kuhlman
    Lauren Kuhlman says:

    Just wanted to say thanks. That helped me out. I got one of the sites I wanted working by just changing the website address. I can’t quite seem to get the second working with your original XSLT file. I guess I better go read up on how XSLT works.

    • Agnes Riley
      Agnes Riley says:

      You’re welcome. Yeah, XSLT is tricky. I found this style sheet somewhere some time ago; didn’t write it myself. I should probably edit my post to say that. 🙂

Trackbacks & Pingbacks

  1. […] popular request I updated the article on Importing RSS Feed Into FileMaker with XSLT. I made some edits and also now you can download a demo file. Share with […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply