Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

New XML Chatter Stuff

by demerphq (Chancellor)
on Nov 06, 2005 at 23:49 UTC ( #506185=monkdiscuss: print w/ replies, xml ) Need Help??

Hopefully you haven't noticed, but the internals of the XML feeds have changed. They have been refactored into a new design that hopefully is easier to maintain and work with, as well being more efficient.

The main observable change is that the contents of the INFO tag is now along the same lines as the other tickers. However there are deeper changes.

  • First, The paramater 'fromid' may be used. This will return records newer than a certain record. The point of this is to prevent retransmitting unneeded data. Simply use the message id of the last record on the next fetch and you will get anything new.
  • Second, the parameter 'limit' may be used to change the default of returning the last 10 records. You may return as many records as you like.
  • Third, the parameter 'timeout' may be used to change the default time range of the returned records to something less than 10 minutes.
  • Fourth, the tickers now respect your ignore settings. So if you don't want this don't login for your fetches. (Ie use the anonymonk account to get the data and nobody will be ignored.)
  • Fifth, the two tickers can actually both produce the same output as each other, and a new format as well. Use 'xmlstyle' to override the behaviour, with the values 'old','new' and 'modern'*. (Postmodern will be next I'm sure :-) As the ticker output is cached it does not respect such xmlstyles as 'flat' and 'clean' as the others do. Such is life in the land of one size fits all. (Or in this case, three sizes fits all)
  • And finally, if this change has broken your client you can use the 'oldcache' option to revert back to the old behaviour. Hopefully this shouldn't be necessary however.

* That last bit, the 'modern' output style, is a new format entirely. It uses GMT based timestamps only, includes parsed and unparsed content, and uses both elements and attributes. Its intended to be used by tools using proper XML parsers. Anyway, its layout is entirely up to discussion and change, as its so new that we can do anything. I really look forward to hearing what client authors have to say. Here is a sample. (Newlines in the info tag added for legibility)

<chatter> <info site="http://perlmonks.org/" sitename="Perl Monks" ticker_id="15834" gentimeGMT="2005-11-06 23:35:35" xmlstyle="clean,modern" xmlmaker="XML::Fling 1.001" >Rendered by the Chatterbox XML Ticker</info> <message id="542068699" gmtime="2005-11-06 23:39:17" unixtime="1131320 +357"> <author user_id="108447">demerphq</author> <text>[id://108447]</text> <parsed>&lt;a href="?node_id=108447"&gt;demerphq&lt;/a&gt;&lt;!-- --&g +t;</parsed> </message> </chatter>

Update: atcroft helpfully pointed out that there is no need for a way to override your ignore list.

---
$world=~s/war/peace/g

Comment on New XML Chatter Stuff
Download Code
Re: New XML Chatter Stuff
by PodMaster (Abbot) on Nov 08, 2005 at 07:47 UTC
    I saw this announcement, and it came and went, and then you applied user nodes info xml generator - (patch) (on 2005-11-07 15:07:51), which breaks quite a few clients relying on user nodes info xml generator. It certainly broke xml_pimp.

    I think you should revert that change, at least for a few weeks. Please

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Nope. That patch wont be reverted.

      The user nodes ticker was causing a huge drag on the system, so it was patched to be lower load. The alternative was to patch it out of existance.

      If you want the full data set then will have to do multiple fetches using the 'offset' parameter. Each fetch should return 100 records, if it does return this number then increment offset by 100 and refetch. Eventually it will return less than 100 records and you are done.

      Apologies for not announcing this directly, I was called away unexpectedly before I could do so.

      ---
      $world=~s/war/peace/g

Re: New XML Chatter Stuff
by Aristotle (Chancellor) on Nov 09, 2005 at 00:56 UTC

    I see the parsed output is rendered escaped. So what of the “namespaced real elements” style we were talking about? That would require fixes to XML::Fling?

    This all looks nice so far. No breakage that I can tell in my client, either.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://506185]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-12-18 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (41 votes), past polls