I expect random junk in comments in the HTML source of pages from time to time.



  • What I don't expect is LISP in the Caltrain timetable:

    <!--
       (while (re-search-forward "</th><td" nil t)
         (backward-char 3)
         (save-restriction
           (narrow-to-region (point) (progn (end-of-line) (point)))
           (goto-char (point-min))
           (let ((s '(1 1 3 2 3 2 3 2 2 3 2 3 2 2 3 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 3 2 3 2 3 2 2 3 2 3 2 2 1 1 1 1 )))
             (while s
                (re-search-forward "\\(<td[^<>\n]*>\\)\\([^\n<>]*</td>\\)")
                (replace-match (format "\\1<!%s-%d%s->\\2" "-" (car s) "-"))
            (setq s (cdr s)))
             (or (looking-at "</tr>") (error "Foo")))))
    -->;

     

    (The 1/1/3/2/3 I think matches the local/limited/expressiness of the trains, FWIW.)



  • Do you really view source pages you visit out of boredom to look for html comments? I'm just curious.



  •  That's Emacs Lisp. It doesn't actually generate any of what's on the web page, but when it's open in an editor, it can be run to mark up each <td> cell with a comment containing a number corresponding to the color of the cell. So <td></td> becomes <td><!--3--></td>. The string of numbers is probably generated so that someone can open the source in Emacs and see at a glance what color each cell should be.



  • @Vechni said:

    Do you really view source pages you visit out of boredom to look for html comments? I'm just curious.
     

    I was about to chop it up into for my own use and was ever-so-briefly contemplating writing some sort of a script (before I wised up and decided to poke around with a spreadsheet instead). I now have a pretty table with the times that are relevant to my commuting interests (including both Caltrain and VTA light rail times for select stations).

     

    I recognized the code as elisp (without actually figuring out what it did) and thought it was leftovers from the programmer type putting together the page... I dunno, emacs isn't really something I'd immediately associate with Caltrain either. :)



  • @fennec said:

     I dunno, emacs isn't really something I'd immediately associate with Caltrain either. :)
     

    Someone had to write the website.  Most programmers don't work for technology companies you know.

     



  • @rsg said:

    The string of numbers is probably generated so that someone can open the source in Emacs and see at a glance what color each cell should be.
    So they can paint by numbers?



  •  I am still genuinely interested in how you come across this.... I think maybe an FF extention that parses out comments and displays them in a sidebar would be neat. I've seen some WTFs regarding commented out xss vulns (the person who commented them out didn't even know they were vulnerablities, they simply didn't understand how versioning software worked). So just being able to chance upon comments (kind of like an alert/notification) without having to go looking for them would be nice, but a lot of it would probably be auto generated/gibberish even when conviently parsed out.



  • Nice find. A quick Google search finds mentions of this here and here, but neither offers an explanation.



  • I used to have a Proxomitron filter that would display comments by escaping the open/close tags. (It had one built in, but that one also escaped everything inside them.) Never found much of interest, although I did note that phpBB (or was it VBulliten?) spews tons of autogenerated comments on every page.



  • @Vechni said:

     I am still genuinely interested in how you come across this.... I think maybe an FF extention that parses out comments and displays them in a sidebar would be neat. I've seen some WTFs regarding commented out xss vulns (the person who commented them out didn't even know they were vulnerablities, they simply didn't understand how versioning software worked). So just being able to chance upon comments (kind of like an alert/notification) without having to go looking for them would be nice, but a lot of it would probably be auto generated/gibberish even when conviently parsed out.

     

    Like I said in my earlier post: I was about to chop it up (the Caltrain timetable) for my own use (to make a personal San Jose Diridon to [Lawrence | Sunnyvale] morning and evening commute-hour timetable) and the notion occurred to write some sort of a script (to parse the HTML). Therefore I looked at the HTML to see the quality and estimate the ease of writing a script. It was a cheap operation - instinctive, really, given the work I do. And then, BAM. LISP.

     

    And then I changed my mind about the script and used OpenOffice and put the table next to some VTA times as well, and decided that the 5:21 from Sunnyvale back home was cutting it a little too close, and it's in another fare-zone and more expensive.



  • The real WTF is a block of lisp code that uses not one but TWO while loops 


Log in to reply