Need yahoo pipes help

Discussion in 'Blogging' started by zozor, Feb 24, 2009.

  1. zozor

    zozor Junior Member

    Joined:
    Dec 24, 2008
    Messages:
    113
    Likes Received:
    70
    I have created an associatedcontent scraper. It works perfectly but I always get all the html code in the articles including their ads, links etc.
    I need someone to help me remove html tags from an rss feed
    In exchange I will give the person the scraper
     
  2. dynamicvb

    dynamicvb Regular Member

    Joined:
    Sep 2, 2007
    Messages:
    389
    Likes Received:
    185
    Here is some XSL to remove the html from a blogger blog. I'm not familar with Yahoo Pipes so you will need to change it to reflect the RSS you are pulling in, but this should give you a start with a example of how to remove html from a feed.

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:atom="http://www.w3.org/2005/Atom"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:dc="http://purl.org/dc/elements/1.1/">
       <xsl:output method="html"/>
     <xsl:template match="/">
      <style>
       <xsl:comment>
       .syndication-content-area {
       }
       .syndication-title {
        font-size: 1.1em;
        font-weight: bold;
       }
       .syndication-description {
        font-size: .9em;
        margin: 0 0 10px 0;
       }
       .syndication-list {
        font-size: .8em;
        margin:0 0 0 20px;
       }
       .syndication-list-item {
        margin: 0 0 5px 0;
       }
       .syndication-list-item a,
       .syndication-list-item a:link {
        color: blue;
       }
       .syndication-list-item a:active,
       .syndication-list-item a:hover {
        color: red;
       }
       .syndication-list-item a:visited {
        color: black;
        text-decoration: none;
       }
       .syndication-list-item-date {
        font-size: .8em;
       }
       .syndication-list-item-description {
        font-size: .9em;
       }
       </xsl:comment>
      </style>
      <xsl:apply-templates select="/atom:feed"/>
     </xsl:template>
     <xsl:template match="/atom:feed">
      <div class="syndication-content-area">
       <div class="syndication-title">
        <xsl:value-of select="atom:title"/>
       </div>
       <div class="syndication-description">
        <xsl:value-of select="atom:tagline"/>
       </div>
       <ul class="syndication-list">
        <xsl:apply-templates select="atom:entry"/>
       </ul>
      </div>
     </xsl:template>
     <xsl:template match="atom:entry">
        <li class="syndication-list-item">
            <a href="{atom:link/@href}">
                <xsl:value-of select="atom:title"/>
            </a>
            <div class="syndication-content-area ">
                <xsl:call-template name="strip_HTML">
                    <xsl:with-param name="value" select="atom:content" />
                </xsl:call-template>
            </div>
       </li>
    </xsl:template>
     
    <xsl:template name="strip_HTML">
    <xsl:param name="value"/>
    <xsl:choose>
    <xsl:when test="contains($value,'<')">
    <xsl:value-of select="substring-before($value,'<')" disable-output-escaping="yes"/>
    <xsl:choose>
    <xsl:when test="contains(substring-after($value,'<'),'>')">
    <xsl:call-template name="strip_HTML">
    <xsl:with-param name="value"><xsl:value-of select="substring-after($value,'>')"/></xsl:with-param>
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$value" disable-output-escaping="yes"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    
    </xsl:stylesheet>
    
    
     
    • Thanks Thanks x 1
  3. zozor

    zozor Junior Member

    Joined:
    Dec 24, 2008
    Messages:
    113
    Likes Received:
    70
    Thanks for your help
    I have found a site which does that its called blastcasta.com
     
  4. blackhatnoob

    blackhatnoob Junior Member

    Joined:
    Nov 9, 2008
    Messages:
    173
    Likes Received:
    20
    I use regex filter out <.*?> and replace it with a space.
     
  5. undeterminederror

    undeterminederror BANNED BANNED

    Joined:
    Mar 31, 2008
    Messages:
    630
    Likes Received:
    457
    how you use that? can you be more specific please ?
     
  6. Sippy79

    Sippy79 Junior Member

    Joined:
    Feb 13, 2009
    Messages:
    104
    Likes Received:
    26
     
  7. undeterminederror

    undeterminederror BANNED BANNED

    Joined:
    Mar 31, 2008
    Messages:
    630
    Likes Received:
    457
     
  8. zozor

    zozor Junior Member

    Joined:
    Dec 24, 2008
    Messages:
    113
    Likes Received:
    70
    You need to use that with yahoo pipes
    Try to create a pipe and you will understand immediately
     
  9. iglow

    iglow Elite Member

    Joined:
    Feb 20, 2009
    Messages:
    2,079
    Likes Received:
    861

    Where do you put that code exactly? I mean - it wont fuck up the Theme?
    Please explain between which tags or what section u put that, Thanx!