1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Question about RSS feeds (primarily ContentType)

Discussion in 'C#' started by pher, Jun 21, 2006.

  1. #1
    I'm attempting to validate my rss feed on my website using feedvalidator.org.

    This is my warning message:

    Your feed appears to be encoded as "utf-8", but your server is reporting "US-ASCII"

    I'm setting the contenttype to "text/xml", but for some reason it won't display as XML. Just shows up as a blob of text with no formatting. IE seems to be intelligent enough to recognize it as xml, but the validator doesn't.

    I'm using C# and XmlTextWriter.
    SEMrush
    ASPX code that calls the rss method:
    Response.ContentType = "text/xml";
    options.GetRSS(Response.OutputStream, reader);
    Code (markup):
    reader is an OleDBDataReader.

    Any thoughts? Does it really matter?

    Feed can be seen here:

    rss_top10plays.aspx

    Thanks in advance.
     
    pher, Jun 21, 2006 IP
    SEMrush
  2. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #2
    I use the following in ASP
    ----------------
    <%Response.ContentType = "text/xml"%><%Response.CharSet = "UTF-8"%><?xml version="1.0" encoding="UTF-8" ?>
    ----------------
    try not to have a blank line in the begining
     
    ludwig, Jun 21, 2006 IP
  3. pher

    pher Well-Known Member

    Messages:
    403
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    125
    #3
    Charset seemed to do the trick. Thanks.

    How important is the GUID element?
     
    pher, Jun 21, 2006 IP
  4. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #4
    I am not sure about that .........................

    Never used it.
     
    ludwig, Jun 22, 2006 IP
  5. weppos

    weppos Well-Known Member

    Messages:
    99
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    125
    #5
    GUID element is really important for a correct feed management.
    It uniquely identifies the item and let feed readers know if an item is changed.

    For example, if you create a feed with 10 items and tommorow you'll change a few details on the feed, without a guid the most part of feed readers will display to users all items as new.

    If you put a guid no matter what you change, if the guid is the same the feed status will be the same too as long as you don't change that string.

    Many parsers use guid to check if an item has already been processed instead of checking item content.
     
    weppos, Jun 30, 2006 IP
    pher likes this.