martes, 4 de enero de 2011

consultar fuentes RSS desde Excel

http://chandoo.org/wp/2008/07/30/rss-feeds-excel/

y por si desaparece del enlace:
RSS feeds are everywhere. So much that you cannot avoid them in your data processing, analytics or day to day spreadsheet needs.

If you can get the RSS feeds to excel sheet you can do pretty interesting things with it, like:

  • Prepare a sheet to watch deals on Amazon, Craigslist, Deals2buy and other favorite sites
  • Watch news, alerts on your company / brand / blog using technorati, google news etc.
  • So much more, just use your imagination

Of course, Excel 2003 (and above) has XML import option using which you can get any XML files (and thus RSS files too) and show them in spreadsheet. But the problem is, the layout is messy, and too confusing. So here is a simpler way to read RSS/ATOM/XML feeds from excel sheets.

For this example, let us build an excel sheet that will fetch Amazon Gold box Today’s deals RSS feed show all deal titles and product URLs.

  1. First Create a new Google Docs – Spreadsheet

    We will use a round about way to get RSS feed to our excel sheet. Create a new google docs – spreadsheet. We will now use google’s importfeed() external data function. This function fetches external feed data and loads it in to the spreadsheet. We will write this function in 2 columns, one for the feed title telling us what the goldbox deal is about and another with the product’s URL.

    The syntax will look like: =ImportFeed("http://rssfeeds.s3.amazonaws.com/goldbox", "items title",true,20) for deal title and =ImportFeed("http://rssfeeds.s3.amazonaws.com/goldbox", "items url",true,20) for the URL.

    When done, the sheet should display gold box deals like below:

    amazon-gold-box-feed-google-docs

  2. Now share the google doc as text file to access from excel sheet

    Once the feed is fetched to the google doc, we will share this sheet as a txt file so that we can read the gold box deals from excel.

    You can share the google doc by clicking “Publish” option available to the right.

    We will select the “more publishing options” to share this sheet as a txt file. Click here to see a sample shared txt file containing latest 20 gold box deals.

    Make sure you have clicked on the “Automatically republish this document when changes are made” option.

  3. Finally read the text file from excel using web queries

    In the excel sheet we will create a new web query to connect to our shared text file using menu > data > import external data > new web query as shown below:

    import-web-pages-to-excel-sheet

    We will mention the URL of the shared google doc in the web query dialog and select everything. See below:

    web-query-excel-howto

    That is all, we have now fed our excel sheet with tasty gold box deals. When you need new deals just “refresh data” :)

    download the excel sheet with rss feeds to spreadsheet example and play around

Do you like this? Tell me what would you do if you get RSS feeds to excel sheets?

No hay comentarios:

Publicar un comentario