Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

New Service: Thread Watcher

by jdporter (Canon)
on Jul 10, 2007 at 19:04 UTC ( #625902=monkdiscuss: print w/ replies, xml ) Need Help??

Update: The service is defunct. The code for it was only on perlmonk.org, which now seems to be down for the count. Please disregard the below. My regrets to all.


New Service: Thread Watcher

In response to many requests throughout history, including but almost certainly not limited to the following —

I have created a thread watcher service. (Note - it does not implement every feature of every request in the above-cited threads.)

Its public interface is implemented entirely via private messaging.
You send commands to the service via

    /msg watcher ....
and watcher sends responses to you in your message inbox.

Full documentation for the service should always be available on watcher's homenode. This service is still quite new, and will probably be undergoing significant development in the coming months.

This is not an official service of PerlMonks. It is hosted off site. All comments, questions, suggestions, and complaints about it should be directed to me. Being hosted on perlmonk.org, there is no guarantee that it will be around forever. Please do not use watcher while operating heavy machinery.

A word spoken in Mind will reach its own level, in the objective world, by its own weight

Comment on New Service: Thread Watcher
Free Nodelet Hack: Add watch on current node
by jdporter (Canon) on Jul 10, 2007 at 19:36 UTC

    If you plunk the following code in your Free Nodelet, you'll have a button with which you can easily (one click) add a watch on the currently viewed node.

    <form method="get" action="?" enctype="application/x-www-form-urlencod +ed"> <input type="hidden" name="node_id" value="`author_id`"> <input type="hidden" name="op" value="message"> <input type="hidden" name="replyto" value="user"> <input type="hidden" name="sendto" value="watcher"> <input type="submit" name="replytotext" value="watch `id`"> <input type="hidden" name="sexisgood" value="submit"> </form>

    It's a little squirrely in that it leaves you on the homenode of the author of the node, but a simple Back in your browser fixes that.

    If you want to be automatically redirected back to the node you were on when you clicked the button, make sure you have _redir handled in your free nodelet, as described in Free Nodelet Hack: Toggle Between Two Nodelet Configurations, and then add the following line to the above form:

    <input type="hidden" name="_redir" value="`id`">

    Update, per tye's goading^Wencouragment:

    <form method="post" action="?" enctype="application/x-www-form-urlenco +ded"> <input type=hidden name=node_id value="`id`"> <input type=hidden name=op value="message" /> <input type=hidden name=sexisgood value="Send" /> <input type=hidden name=replyto value="user" /> <input type=hidden name=sendto value="watcher" /> <input type=submit name=replytotext value="watch `id`" /> </form>
    A word spoken in Mind will reach its own level, in the objective world, by its own weight

      I'm assuming that you don't simply replace:

      <input type="hidd­en" name="node­_id" value="`au­thor_id`">

      with

      <input type="hidd­en" name="node­_id" value="`id`">

      and avoid the "squirreliness" and inefficient _redir hackery out of (based on stuff you said in the CB) some mistaken impression you have that op=message works in user home nodes but not on arbitrary thread nodes.

      So I repeat (more clearly) that whatever problem you saw you have probably mischaracterized the cause because I know of no reason why the above simple solution wouldn't work and I encourage you to try again and figure out why it doesn't so whatever bug can be fixed (if the problem you had wasn't actually due to something outside of PerlMonks).

      Thanks.

      - tye        

Re: New Service: Thread Watcher
by Limbic~Region (Chancellor) on Jul 10, 2007 at 19:38 UTC
    jdporter,
    This is nice. Thank you very much. When I was working on this externally before, there were a few issues holding me up.

    The first is that my implementation took the wrong approach. No work would be done unless the user "checked in" to see what nodes had been updated. After tye kindly pointed out the error of my ways, I started to re-implement but lost momentum for some of the other reasons.

    The second was that I also wanted to include the ability to tell when a node's content had changed as well as if a new node had been added. While there is a flag in XML view that may be used, it currently isn't useful. If I understood tye just now in the CB, this will be possible when the new node cache is in production.

    The third was that I was trying to be really resource friendly to PM. I don't think I knew about the XML Node Thread generator at the time. If I had, I could have easily performed the work off-site. Even then, watching a thread rooted at node X is still not straight-forward. How have you done it? Update: If I have understood the CB conversation correctly, you are only monitoring direct replies and not any indirect replies below a specific node.

    Finally, I only had a year of perl under my belt and was working alone as a non-devil. If I remember correctly, I generated HTML using CGI rather than a templating framework. After feedback from tye on a few things I could have done a much better job but it was unrealistic of me to expect him to coach me through the entire process so I abandoned it.

    That was 4 years ago. Thank you so much for taking this on and I hope very much the items on your todo list along with the content update gets included too. If you aren't also monitoring a thread rooted at node X, that would be great too.

    Cheers - L~R

Re: New Service: Thread Watcher
by blazar (Canon) on Jul 11, 2007 at 11:46 UTC
    In response to many requests throughout history, including but almost certainly not limited to the following —
    [snip]
    I have created a thread watcher service. (Note - it does not implement every feature of every request in the above-cited threads.)

    As the author of one of those requests, I'd like to thank you so much and I'm very excited about this new service, however experimental it could be.

    Full documentation for the service should always be available on watcher's homenode. This service is still quite new, and will probably be undergoing significant development in the coming months.

    Very well done! BTW: you may include there a link to this very thread itself, along the lines of my birth announcement.

    And now... let the feature requests begin! I think I'll be using the Free Nodelet hack but how about letting one post in addition to the id of the page also a link in the PM specific form of [id://625908], in which case it would have to be parsed... I'm sure many of us, especially amongst those using monklinks, would benefit from such an enhancement.

    BTW: are future enhancements expected to be posted here? If so I'm watching this very thread soon...

    This is not an official service of PerlMonks. It is hosted off site. All comments, questions, suggestions, and complaints about it should be directed to me. Being hosted on perlmonk.org, there is no guarantee that it will be around forever.

    Well, one nice point of PerlMonks is the existence of a bunch of side projects -like perlmonk.org itself- which further enhance its value. I don't know how many sites and forums can say the same. Of course it's also thanks to its own structure that evidently allows all this to come into existence: it gives a large number of degrees of freedom, and while we're dreaming we can also dream of all these additional features as experimental ones that one day will become more closely integrated with the home site itself, since dreams do not cost anything, after all!

      how about letting one post ... a link in the PM specific form of [id://625908],

      Actually, that is already supported. I just didn't document it.

      A word spoken in Mind will reach its own level, in the objective world, by its own weight

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2014-10-20 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (75 votes), past polls