Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Finding posts with zero replies.

by doowah2004 (Monk)
on Aug 30, 2004 at 13:08 UTC ( [id://386908]=monkdiscuss: print w/replies, xml ) Need Help??

Is there a way to search the 'Seekers of Perl Wisdom' for posts that have not been replied to. It would be cool to see who still needs help, and fun to see which ones are the more challenging issues.

This may be possible, but I did not see a way to do it, and a quick search of the site did not result in any answers.

Replies are listed 'Best First'.
Re: Finding posts with zero replies.
by PodMaster (Abbot) on Aug 30, 2004 at 13:12 UTC
      PodMaster,
      I spent a little time with Super Search and couldn't find anything applicable. I then looked at PTAV and didn't see a way to do this. That's when I whipped up the following:
      #!/usr/bin/perl use strict; use warnings; use HTML::TableContentParser; use HTML::TokeParser::Simple; use WWW::Mechanize; use constant SOPW => '&ct=12'; my $mech = WWW::Mechanize->new( autocheck => 1 ); $mech->get( 'http://www.tinymicros.com/ptav/index.pl' ); open (OUTPUT, '>', $ARGV[0] || 'noreplies.txt'); select OUTPUT; $| = 1; print OUTPUT "<html>\n<ul>\n"; for my $year ( $mech->find_all_links( url_regex => qr/year/ ) ) { $mech->get( $year->url() ); for my $month ( $mech->find_all_links( url_regex => qr/month/ ) ) +{ $mech->get( $month->url() ); for my $day ( $mech->find_all_links( url_regex => qr/day/ ) ) +{ $mech->get( $day->url() . SOPW ); my $table = HTML::TableContentParser->new()->parse( $mech- +>content() ); for my $row ( @{ $table->[-2]{rows} } ) { for my $cell ( @{ $row->{cells} } ) { if ( $cell->{data} =~ /\(0\)/ ) { print OUTPUT "<li>", clean_link( $cell ), "</l +i>\n"; next; } } } sleep 3; $mech->back(); } $mech->back(); } $mech->back(); } print OUTPUT "</ul>\n</html>\n"; sub clean_link { my $link = shift; my $p = HTML::TokeParser::Simple->new( \$link->{data} ); my $node; while ( my $token = $p->get_token ) { last if $token->is_end_tag; if ( $token->is_start_tag( 'a' ) ) { ($node) = $token->return_attr( 'href' ) =~ /(\d+)$/; next; } if ( $token->is_text ) { return "<a href='http://www.perlmonks.org/index.pl?node_id +=$node'>" . $token->as_is . "</a>"; } } }
      It generates a list of all root SoPW nodes without replies. The two alternatives I have seen are even more lacking:
      • Use a modified view of Newest Nodes
      • This doesn't allow you to look at anything past a certain data and has no means of filtering beyond visual cues.
      • Use PTAV as built
      • This requires looking day by day and has no means of filtering beyond visual cues.

      Cheers - L~R

      Update:Added explanation of screen scraping and modified the code to only look at SoPW since that was all that was being asked for. Needs a resume capability so that if it breaks you can start where you left off.
      I do not mean to be obtuse, but I still do not see a way to filter out the posts that have replies so that we can view only the posts without replies.

      If you could sort by the number of replies, instead of newest or oldest, that would be ideal.

      It is not all that important, I just thought it would be cool.
        I do not mean to be obtuse, but I still do not see a way to filter out the posts that have replies so that we can view only the posts without replies.
        Did you super search for the previous discussion? I always think PTAV lets you do this (it should). Unanswered post search?

        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.

Re: Finding posts with zero replies.
by talexb (Chancellor) on Aug 30, 2004 at 17:49 UTC

    To expand on PodMaster's somewhat cryptic post, check out this page to show today's posts. It does indeed show the number of replies, even though it's agreed that number of replies doesn't necessarily suggest that the question has been fully answered.

    Here's how I looked: I search for PTAV in the Search field above, got nothing, started a Super Search with PTAV, and while that was running also googled for PTAV. The Google search finished first, and one of the results was a directory path below tinymicros.com (Sorry, not .net) -- kind of a cousin site to Perl Monks. Clicking on that and drilling down to today's date gave me the link you see at the top of this reply.

    So, the short answer (yeah, at the end of my post) is that this functionality has already been coded off-site, hence it will not likely make its way into Perl Monks.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      talexb,
      The functionality being requested hasn't been coded locally or offsite. As I noted in my reply, you get no filtering capability with either alternative - only visual cues. Now providing a complete list is only marginally better. What would be optimal would be to add a feature to Super Search that specified the number of replies:
      • Radio box to select either gt, lt, eq
      • Text box to specify the number of replies
      Now, not being a devil, I doubt this is very feasible as I don't think nodes track number of children. I really like the idea and came up with something I think is better, but still not optimal.

      Cheers - L~R

        Hmm, well the original question asked about 'finding posts with zero replies', and it seems to me (for example, this post) that it's working as advertised.

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Re: Finding posts with zero replies.
by ambrus (Abbot) on Aug 30, 2004 at 15:48 UTC
Re: Finding posts with zero replies.
by sfink (Deacon) on Aug 31, 2004 at 04:55 UTC
    I haven't looked, but I wouldn't surprised if you ended up drowning in stupid questions, suspiciously homework-ish queries, extremely domain-specific questions, and other such jetsam. Maybe I'm wrong, though.

    In my experience, when I've asked a really nasty question that nobody had an answer for, it tends to be upvoted pretty heavily. Which is nice, since it's sort of a consolation prize: "well, I didn't get an answer, but at least I came away with a few dozen more XP!" That might make for search with a higher signal/noise ratio -- "find me SOPW posts with zero replies and somewhat high reputation". Judging from personal experience, it should be valid: if I read a question and think "wow, I have no clue, but I'd love to hear the answer", I often upvote it.

    Your request also brings to mind a possible modification to the site to encourage monks to answer old but worthwhile questions. Part of the problem is that you could trawl through old questions and answer what you could, but you would never get that great meaningless-yet-satisfying XP boost you would from answering a recent question. It's because the recent questions get a lot more visitors, while nobody but the poster will ever see your reply to an older question.

    So what if we allow the original poster to say whether a question has been properly answered yet or not? Hardly anyone would bother filling it out most of the time, of course -- it's one extra little thing to do that everyone would forget. And why not? The OP has the answer s/he was looking for already. But what if marking an old question -- say, at least a week stale -- as answered automatically popped it back into the list of current items (with a note explaining why it is mixed in with all the recent stuff)? Then people who cared about the same question could click on it and get their answer, so they're happy, and the answerer would get the upvotes, so s/he's happy. So while I would guess that few would bother to mark their recent questions as answered, people would have incentive to mark their old unanswered questions as answered, and hence people would have incentive to trawl through the archives, looking for those older but more difficult queries.

    What do y'all think?

      I think sfink may be on to something. His idea could kill two birds with one stone (in theory). One is the idea of having an easy way to find un-replied-to questions, which is the subject of at least two threads lately. The other idea is being able to know if a question someone else asked has been answered; useful if you want to know the answer, too. Now, I know I could do this already by checking the new nodes every day (which I do), but having it automatic would be cool.

      Of course just because something's cool doesn't mean it's worth the work to implement. I don't know how hard these ideas would be to implement.

      I haven't tried Limbic~Region's code yet, he says it generates a list of all root SoPW nodes with no replies. If it works, that might satisfy the first idea OK.

      Now I'm just thinking as I'm typing here, and I'm wondering: Can the average monk write some code to satisfy the second idea? L~R wrote the code above, and I've run across a bunch of things monks have apparently done on their own to get just the right data they want (stats and such).

      So, is it possible for the average monk to write code that interacts with the site's data? If so, what kinds of things are possible? How hard is it? (I know, it depends on my skills ;)

      Anyway, maybe the answer for both these ideas is "non-official" code that a monk could provide a link to.

      TheEnigma

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://386908]
Approved by Limbic~Region
Front-paged by Limbic~Region
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-16 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found