1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

RSS feed broken

Discussion in 'Jailbreak General' started by tarquin, Mar 20, 2006.

  1. tarquin

    tarquin design is flawed

    Joined:
    Oct 11, 2000
    Messages:
    3,945
    Likes Received:
    0
    Some clients report they can't load our RSS feed, eg Firefox.
    The validator says it's broken too.

    I don't know how to fix this, and my ongoing problems connecting to FTP aren't helping.

    Please could someone look at this?
     
  2. tarquin

    tarquin design is flawed

    Joined:
    Oct 11, 2000
    Messages:
    3,945
    Likes Received:
    0
    The problem seems to be the
    insert News.createtime

    function adding evil characters to the time:
    0000 00000000

    and also producing only zeros.
     
  3. Jrubzjeknf

    Jrubzjeknf Registered Coder

    Joined:
    Mar 12, 2004
    Messages:
    1,276
    Likes Received:
    0
    take out the function?
     
  4. tarquin

    tarquin design is flawed

    Joined:
    Oct 11, 2000
    Messages:
    3,945
    Likes Received:
    0
    it's Mych's format function that's at fault somehow.
     
  5. tarquin

    tarquin design is flawed

    Joined:
    Oct 11, 2000
    Messages:
    3,945
    Likes Received:
    0
    Well that would break *everything*
     
  6. tarquin

    tarquin design is flawed

    Joined:
    Oct 11, 2000
    Messages:
    3,945
    Likes Received:
    0
    basically, Mych is using weird codes I don't understand.

    \0\cq

    is later getting matched as if it were

    \0\cl

    WTF?
     
  7. Ikkuh

    Ikkuh Phear the nades

    Joined:
    Apr 19, 2005
    Messages:
    107
    Likes Received:
    0
    timing in other XML files I have looked through are like this:
    <pubDate>Mon, 20 Mar 2006 14:45:48 +0100</pubDate>
    so there must be something wrong with that.

    Can you change EST into -0900 (or whatever that is), and the block into :, and maybe add good times?

    or does the RSS creation file work different?
     
  8. Jrubzjeknf

    Jrubzjeknf Registered Coder

    Joined:
    Mar 12, 2004
    Messages:
    1,276
    Likes Received:
    0
    upload the creation file?
     
  9. tarquin

    tarquin design is flawed

    Joined:
    Oct 11, 2000
    Messages:
    3,945
    Likes Received:
    0
    The problem is in this somewhere...
    $template is "HH:mm:ss".

    Code:
        $template =~ s[HH  ] [\0\ck]gx;
        $template =~ s[H   ] [\0\cl]gx;
        $template =~ s[A   ] [\0\cm]gx;
        $template =~ s[a   ] [\0\cn]gx;
        $template =~ s[hh  ] [\0\co]gx;
        $template =~ s[h   ] [\0\cp]gx;
        $template =~ s[mm  ] [\0\cq]gx;
        $template =~ s[m   ] [\0\cr]gx;
        $template =~ s[ss  ] [\0\cs]gx;
        $template =~ s[s   ] [\0\ct]gx;
    
        $template =~ s[\0\ck] { sprintf '%.2d',            (serialtime $a)[0]       }gex;
        $template =~ s[\0\cl] {                            (serialtime $a)[0]       }gex;
        $template =~ s[\0\co] { sprintf '%.2d',           ((serialtime $a)[0] - 1) % 12 + 1}gex;
        $template =~ s[\0\cp] {                           ((serialtime $a)[0] - 1) % 12 + 1}gex;
        $template =~ s[\0\cq] { sprintf '%.2d',            (serialtime $a)[1]       }gex;
        $template =~ s[\0\cr] {                            (serialtime $a)[1]       }gex;
        $template =~ s[\0\cs] { sprintf '%.2d',            (serialtime $a)[2]       }gex;
        $template =~ s[\0\ct] {                            (serialtime $a)[2]       }gex;
    
        $template =~ s[\0\cm] { (serialtime $a)[0] < 12 ? 'A' : 'P' }gex;
        $template =~ s[\0\cn] { (serialtime $a)[0] < 12 ? 'a' : 'p' }gex;
    
        return $template;
    
    and serialtime is:

    Code:
    sub serialtime ($) {
    
      my $serial = shift;
    
      my $hour;
      my $minute;
      my $second;
    
      $hour   = int ($serial / 3600);  $serial %= 3600;
      $minute = int ($serial /   60);  $serial %=   60;
      $second =      $serial;
    
      return ($hour, $minute, $second) if wantarray;
      return "$hour:$minute:$second";
      }
    
     
  10. Mychaeel

    Mychaeel New Member

    Joined:
    Oct 3, 2001
    Messages:
    3,830
    Likes Received:
    0
    I've fixed the problem. Some Perl update must have introduced a change in how the "\cX" escapes are handled either in string literals or regular expression patterns. I've replaced them by the corresponding octal "\XXX" escapes.

    My, that code is old. Those were the times... *dreams*
     
  11. tarquin

    tarquin design is flawed

    Joined:
    Oct 11, 2000
    Messages:
    3,945
    Likes Received:
    0
    Thanks Mych :)
     

Share This Page