ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Magpie and Google Hotest trends

May 20, 2009 1:01am

Subscribe [2]
  • #1 / May 20, 2009 1:01am

    trixpan

    9 posts

    Hi there,

    I started doing some tests with the magpie rss parser add on and lacking a RSS on my mind I decided to get the RSS from the next open tab, in other words, Google trends RSS feed.

    I followed the basic example but for my surprise the parsing was caothic.

    My template is simple as:

    <html>
    <head>
    <title>just a simple test</title>
    </head>
    <body>
    {exp:magpie url="http://www.google.com/trends/hottrends/atom/hourly" limit="5" refresh="720"}
    {feed_type}
    <ul>
    {items}
    <li><a href="http://{link}">{title}</a></li>
    {/items}
    </ul>
    {/exp:magpie} 
    </body>

    But the output is far from expected, looking like:

    html>
    <head>
    <title>just a simple test</title>
    </head>
    <body>
    
    Atom
    <ul>
    
    <li><a href="http://">glee imdb, steve wozniak, no boundaries lyrics, ...</a></li>
    
    <li><a href="">Watch <b>Glee</b> Tonight After American Idol!<ht:title >
    
    <ht:snippet ><b>...</b> as he tries to inspire a multi-cultural group of underachievers with little hearts of gold. Songs and hilarity will certainly ensue, and I'm sure we'll all learn something by the end of the episode. If you'd like more information about the new TV show, check out <b>Glee's IMDb</b> site (first link).<ht:snippet >
    <ht:source >RantRave | Published Opinion.<ht:source >
    <ht:source_url >http://www.rantrave.com/Rave/Watch-Glee-Tonight-After-American-Idol.aspx<ht:source_url >
    <ht:image height="52" width="80" url="http://news.google.com/news?imgurl=http://www.rantrave.com/userimages/posts/2041_Medium.jpg?074611"><ht:image ><ht:entry >
    
    <ht:pos >2<ht:pos >
    <b>Steve Wozniak</b> Joins TechForEducators.com Board of Advisors<ht:title >
    <ht:snippet >By Filip Truta, Apple News Editor TechForEducators.com has announced that the inventor of the personal computer, <b>Steve Wozniak</b>, has joined the company's board of advisors. <b>Wozniak</b> co-founded Apple Inc. with <b>Steve</b> Jobs in 1975 and created Apple's first line of products, the Apple I and II. <b>...</b><ht:snippet >

    Am I missing something in here?

  • #2 / May 20, 2009 3:04am

    John Henry Donovan

    12339 posts

    trixpan,
    the Google Atom feed seems to be set up a bit differently but you can get what you want by using the following.

    <html>
    <head>
    <title>just a simple test</title>
    </head>
    <body>
    {exp:magpie url="http://www.google.com/trends/hottrends/atom/hourly" limit="1" refresh="720"}
    {feed_type}
    <ul>
    {items}
    <li><a href="http://{link}">{title}</a>{content}</li>
    {/items}
    </ul>
    {/exp:magpie}
    </body>

    For testing I always use an EllisLab feed such as http://expressionengine.com/feeds/atom/full/

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases