• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

TNS Breaking News Generator

robject

SOC-14 10K
Admin Award
Marquis
This question is primarily for myself, Berka, Jeffro, and a couple other Perl programmers and other dynamic programmers out there.

I reckon we could write a small Perl script which, when invoked, reads the top story from an RSS newsfeed, detects proper names, replaces them from a ready stock of substitutes, morphs the date to Imperial, and displays the results as a TNS bulletin.

It's also quite doable to simply hash-scramble proper names into pseudo Vilani.

What other gotchas would we need to detect? (The nice thing about dynamic programming is that development of small tools like this is strongly iteration-driven).
 
got to thinking about this as well (darn you Rob!) A DB to also track where you've replaced a specific name so that it can be re-used. For example, the Haiti stuff: if Haiti got replaced by a specific system or whatever, it should then consistently substitute that replacement name, along with other pertinent data such as the date picked (although, as RSS feeds do have a date, I suppose you could simply swap out the day with the day of the year (i.e., today is Jan 24, and our TNS feeds are for 1105, so it is 024-1105. That way there can be consistency in dates, if anyone is actually checking)

And my new job has perl scripts. Large, 9000+ line scripts which have become my job to find the old errors. I've never looked at perl before, but fortunately I've decades of C, grep, awk & Unix/linux background, so perl is pretty easy to pick up (although there are a few interesting gotchyas!). And I've managed to find a couple errors already (hard part was even finding the scripts & setting up svn to prevent me screwing things up!).

But it can be one ugly language, particularly for people who pick it up without an actual background of programming and a sense of programming style. Fortunately, I found a perl tidy program I've been using to help parse the results of 5+ years of multiple 'programmers' mucking about. And I hate 'cuddled else statements'!

edit: you could simply keep a local CSV list & load it into a hash table internally rather than a DB to track substitutions. I may have to start playing with Perl at home, although I really don't want to. But I do like the idea.
 
Last edited:
got to thinking about this as well (darn you Rob!) A DB to also track where you've replaced a specific name so that it can be re-used.

Don't know if it would be worth anyone's time to go that far, but sure.

And my new job has perl scripts. Large, 9000+ line scripts which have become my job to find the old errors. I've never looked at perl before, but fortunately I've decades of C, grep, awk & Unix/linux background, so perl is pretty easy to pick up (although there are a few interesting gotchyas!). [...]
But it can be one ugly language, particularly for people who pick it up without an actual background of programming and a sense of programming style. [...] And I hate 'cuddled else statements'!

QFT x 3.

edit: you could simply keep a local CSV list & load it into a hash table internally rather than a DB to track substitutions. I may have to start playing with Perl at home, although I really don't want to. But I do like the idea.

Now you're starting to think like a Perl programmer. But you won't be a Jedi until you realize that Perl data structures are best dumped and loaded directly with Data :: Dumper. No fooling around with CSV or a db.
 
Back
Top