Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->General: General Discussion Page: 1 2 3 ...10  Previous   Next
Topic Post Count Per User
Author Message
DVD Profiler Unlimited Registrantgoodguy
Sita Sings the Blues
Registered: March 14, 2007
Reputation: Superior Rating
Germany Posts: 1,029
Posted:
PM this userDirect link to this postReply with quote
Inspired by yet another attempt of a well known forum user to render any discussion impossible by spamming a topic, I came up with this little educational exercise.

You can save the code below to an HTML file, call it up in your browser, enter an Invelos topic number and get the number of posts in that topic for each participating user, sorted both by name and by count, along with percentage.

Please note:
  • Only tested with IE, don't know if it works with other browsers.

  • On Windows XP and newer, you have to unblock the created HTML file to enable scripting.

  • You must be logged into the Invelos forums, the script uses the currently active login.

  • The script calls up all topic pages, so this may take a while.

  • In order to get unbiased results, you have to remove any forum blocks


  • BTW, the top 5 participants of the topic in question were:

    53 posts = 21 %  skipnet50
    27 posts = 10 %  Addicted2DVD
    20 posts =  8 %  Rifter
    13 posts =  5 %  Telecine
    12 posts =  5 %  m.cellophane

    I don't know if it is allowed to link to the Rules Committee forum from the outside, but anyone who has access there knows the topic in question.

    EDIT:
    Small fix to avoid recursion problems if a topic has a lot of pages.


    Quote:

    <HTML>
    <!--
      *** Show topic post count per user ***
      Copyright (c) 2007 Matthias Wolf, Germany AKA goodguy
    -->
    <HEAD>
    <TITLE>Topic Post Count Per User</TITLE>
    <STYLE type="text/css">
    </STYLE>
    <SCRIPT language=javascript>

    var g_oXmlHttp;
    var g_nPageGet;
    var g_nPageDone;
    var g_aStats;
    var g_oByUser;

    function errText(nErrNo, szErrDesc) {
    // Simple error text
      if (szErrDesc != null && szErrDesc != "") return szErrDesc;
      var n = nErrNo;
      if (n < 0) n = n + 0xFFFFFFFF + 1;
      return "Error " + nErrNo + " (0x" + n.toString(16) + ")";
    }

    function errHandler(e) {
    // Simple error handler
      alert(errText(e.number, e.description));
    }

    function pageGetNext() {
    // Get next topic page
      g_nPageGet++;
      try {
        idResult.innerText = "Querying page " + g_nPageGet + "...";
        g_oXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        g_oXmlHttp.onreadystatechange = xmlhttp_onreadystatechange;
        g_oXmlHttp.open("GET", lnkTopic.href + "&pageNum=" + g_nPageGet);
        g_oXmlHttp.send();
      } catch (e) { errHandler(e) };
    }

    function pageAnalyze(szHtml) {
    // Analyzes page and returns true if there are more pages
      var re, m, o, sz;
      try {
        re = /HREF="\/UserProfile\.aspx\?Alias=(.*?)"/ig;
        while ((m = re.exec(szHtml)) != null) {
          sz = m[1];
          o  = g_oByUser[sz];
          if (o == null) {
            o = { user: sz, count: 0 };
            g_oByUser[sz] = o;
            g_aStats.push(o);
          }
          o.count++;
        }
        return (szHtml.search(/<IMG src="\/images\/next\.gif" border=0><\/A>/i) >= 0);
      } catch (e) { errHandler(e) };
      return false;
    }

    function sortByUser(o0, o1) {
    // Array sort callback
      return o0.user.localeCompare(o1.user);
    }

    function sortByCount(o0, o1) {
    // Array sort callback
      var n = o1.count - o0.count;
      if (n != 0) return n;
      return o0.user.localeCompare(o1.user);
    }

    function showResults() {
    // Create result tables
      var szTable;
      var aOut, aFn;
      var i, k, n;
      try {
        szTable = "<TABLE border=1><COLGROUP>"
                + "<COL><COL span=2 align=right></COLGROUP>"
                + "<TR><TH>User</TH><TH>Count</TH><TH>Percent</TH></TR>";
        n = 0;
        for (i = 0; i < g_aStats.length; i++) n += g_aStats[i].count;
        aOut = new Array();
        aFn  = new Array(sortByCount, sortByUser);
        aOut.push("<TABLE border=0>"
          + "<TR><TH>By Count</TH><TH>&nbsp;</TH><TH>By User</TH></TR><TR>");
        for (i = 0; i < aFn.length; i++) {
          g_aStats.sort(aFn[i]);
          if (i != 0) aOut.push("<TD>&nbsp;&nbsp;</TD>");
          aOut.push("<TD>" + szTable);
          for (k = 0; k < g_aStats.length; k++) {
            o = g_aStats[k];
            aOut.push("<TR><TD>" + o.user + "</TD><TD>" + o.count
              + "</TD><TD>" + Math.round(o.count * 100 / n) + "&nbsp;%</TD></TR>");
          }
          aOut.push("</TABLE></TD>");
        }
        aOut.push("</TR></TABLE>");
        idResult.innerHTML = aOut.join("\n");
      } catch (e) { errHandler(e) };
    }

    function xmlhttp_onreadystatechange() {
    // Fires on data retrieval
      try {
        if (g_oXmlHttp.readyState != 4) return;
        if (g_nPageGet == g_nPageDone) return; // Avoid multiple rs==4
        g_nPageDone = g_nPageGet;
        if (g_oXmlHttp.status != 200)
          throw Error("HTTP Error " + g_oXmlHttp.status + " " + g_oXmlHttp.statusText);
        // Avoid recursion by putting next call outside event response
        if (pageAnalyze(g_oXmlHttp.responseText))
          window.setTimeout(pageGetNext, 10);
        else
          window.setTimeout(showResults, 10);
      } catch (e) { errHandler(e) };
    }

    function frm1_onsubmit() {
    // Process form submit locally
      try {
        if (frm1.edtTopic.value == "")
          throw Error("Please enter a topic ID."
            + " See &topicID= in your browser's address bar.");
        lnkTopic.href = "http://www.invelos.com/Forums.aspx?"
          + "task=viewtopic&topicID=" + frm1.edtTopic.value;
        lnkTopic.innerText = lnkTopic.href;
        idResult.innerText = "Querying data...";
        g_nPageGet = g_nPageDone = 0;
        g_aStats = new Array();
        g_oByUser = {};
        pageGetNext();
      } catch (e) { errHandler(e) };
      return false;
    }

    </SCRIPT>
    </HEAD>
    <BODY>
    <B>Topic Post Count Per User</B><BR>
    Copyright (c) 2007 Matthias Wolf, Germany AKA goodguy
    <HR>
    <FORM id=frm1 onsubmit="return frm1_onsubmit()">
    Enter topic ID:
    <INPUT type=text id=edtTopic>
    <INPUT type=submit value="Start">
    </FORM>
    Topic URL: <A id=lnkTopic href=""></A>
    <HR>
    <DIV id=idResult>
    </DIV>
    </BODY>
    </HTML>

    Matthias
     Last edited: by goodguy
    DVD Profiler Unlimited RegistrantRossRoy
    Registered: March 13, 2007
    Posts: 793
    Posted:
    PM this userDirect link to this postReply with quote
    Just tried in Firefox, it doesn't work.

    Works wonders in IE7
    DVD Profiler Unlimited Registrantgoodguy
    Sita Sings the Blues
    Registered: March 14, 2007
    Reputation: Superior Rating
    Germany Posts: 1,029
    Posted:
    PM this userDirect link to this postReply with quote
    Quoting RossRoy:
    Quote:
    Just tried in Firefox, it doesn't work.

    Works wonders in IE7



    For Firefox, try replacing the line

    Quote:
    g_oXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");

    with
    Quote:
    g_oXmlHttp = new XMLHttpRequest();


    Just a guess. I don't know for sure if this works, and if it is the only change required.
    If that is all that is needed I can modify the script to support both.
    Matthias
    DVD Profiler Unlimited RegistrantRossRoy
    Registered: March 13, 2007
    Posts: 793
    Posted:
    PM this userDirect link to this postReply with quote
    Quoting goodguy:
    Quote:
    Just a guess. I don't know for sure if this works, and if it is the only change required.
    If that is all that is needed I can modify the script to support both.


    Still doesn't work.

    I enter the TopicID in the field, click go. It then clears the field and just sits there.
    DVD Profiler Unlimited Registrantgoodguy
    Sita Sings the Blues
    Registered: March 14, 2007
    Reputation: Superior Rating
    Germany Posts: 1,029
    Posted:
    PM this userDirect link to this postReply with quote
    Well, I give it one last try, then I leave it to someone who actually uses Firefox.

    I addition to the previous change, replace the line:
    Quote:
    <INPUT type=submit value="Start">

    with
    Quote:
    <INPUT type=submit value="Start" onclick="return frm1_onsubmit()">

    You may have to click the button instead of simply pressing Enter.
    Matthias
    DVD Profiler Unlimited RegistrantRossRoy
    Registered: March 13, 2007
    Posts: 793
    Posted:
    PM this userDirect link to this postReply with quote
    Still doesn't work.
    DVD Profiler Unlimited Registrantgoodguy
    Sita Sings the Blues
    Registered: March 14, 2007
    Reputation: Superior Rating
    Germany Posts: 1,029
    Posted:
    PM this userDirect link to this postReply with quote
    Quoting RossRoy:
    Quote:
    Still doesn't work.

    Then I suggest using a real browser - IE for example.

    P.S.: Please note that I'm not responsible for any injuries caused by the excessive shaking of heads and rolling of eyes after reading the previous sentence.
    Matthias
    DVD Profiler Unlimited RegistrantStar Contributorsurfeur51
    Since July 3, 2003
    Registered: March 29, 2007
    Reputation: Great Rating
    France Posts: 4,479
    Posted:
    PM this userView this user's DVD collectionDirect link to this postReply with quote
    Quoting goodguy:
    Quote:
    Inspired by yet another attempt of a well known forum user to render any discussion impossible by spamming a topic, I came up with this little educational exercise.


    Interesting and funny. But spamming a topic is not the only technique used by some users to avoid any discussion.

    The most irritating one is when they twist the others' statements, then decide themselves what the others think. And when they see that the discussion doesn't take a good way for them, they don't answer anymore in the topic, saying others don't understand, and fly to another topic where they attack once again, twisting once again the others' statements.

    This form of debate is a way to discourage contradictors that I find particularly unpleasant, I even should say disgusting. Some of forum users  (especially one), cannot help doing that several times every day...
    Images from movies
     Last edited: by surfeur51
    DVD Profiler Unlimited RegistrantRossRoy
    Registered: March 13, 2007
    Posts: 793
    Posted:
    PM this userDirect link to this postReply with quote
    Quoting goodguy:
    Quote:
    Then I suggest using a real browser - IE for example.


    Oh I do use IE, even more than Firefox actually
    DVD Profiler Unlimited RegistrantStar ContributorWinston Smith
    Don't be discommodious
    Registered: March 13, 2007
    United States Posts: 21,610
    Posted:
    PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
    Youi know I wasn't going to respond here, but Mathias I find your insunuation bot insulting and disgusting. GO TAKE A HIKE.               If I w3ere Ken I would obliterate this entire thread. What a jerk!!!!!!!!!!!!!!!!!!!!!!

    Skip
    ASSUME NOTHING!!!!!!
    CBE, MBE, MoA and proud of it.
    Outta here

    Billy Video
     Last edited: by Winston Smith
    DVD Profiler Unlimited RegistrantVibroCount
    The Truth is Silly Putty
    Registered: March 13, 2007
    Reputation: High Rating
    United States Posts: 5,635
    Posted:
    PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote




    If it wasn't for bad taste, I wouldn't have no taste at all.

    Cliff
    DVD Profiler Unlimited RegistrantStar ContributorWinston Smith
    Don't be discommodious
    Registered: March 13, 2007
    United States Posts: 21,610
    Posted:
    PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
    Everybody thinks he's a comedian. Thanks i needed that.

    Skip
    ASSUME NOTHING!!!!!!
    CBE, MBE, MoA and proud of it.
    Outta here

    Billy Video
    DVD Profiler Unlimited Registrantgoodguy
    Sita Sings the Blues
    Registered: March 14, 2007
    Reputation: Superior Rating
    Germany Posts: 1,029
    Posted:
    PM this userDirect link to this postReply with quote
    Quoting skipnet50:
    Quote:
    Youi know I wasn't going to respond here, but Mathias I find your insunuation bot insulting and disgusting. GO TAKE A HIKE.               If I w3ere Ken I would obliterate this entire thread. What a jerk!!!!!!!!!!!!!!!!!!!!!!

    Skip

    If you expect me to reply to this by using the same offensive language as you do, I have to disappoint you. While I usually just ignore your inacceptable behavior around here, I think you should be called upon it every once in a while. That you respond to that in the way I fully quoted above (guess why) doesn't come as a surprise to me.

    If Ken thinks that providing a tool for analyzing topic participation violates the forum rules, he can of course lock this topic and delete my first post.
    Matthias
    DVD Profiler Desktop and Mobile RegistrantStar ContributorNadja
    Small and broken
    Registered: March 13, 2007
    United Kingdom Posts: 775
    Posted:
    PM this userView this user's DVD collectionDirect link to this postReply with quote
    Quoting skipnet50:
    Quote:
    Youi know I wasn't going to respond here, but Mathias I find your insunuation bot insulting and disgusting. GO TAKE A HIKE.               If I w3ere Ken I would obliterate this entire thread. What a jerk!!!!!!!!!!!!!!!!!!!!!!

    Skip


    If you were Ken, no-one would come here.
    DVD Profiler Unlimited RegistrantStar ContributorWinston Smith
    Don't be discommodious
    Registered: March 13, 2007
    United States Posts: 21,610
    Posted:
    PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
    Mathias:

    And your behavior is beyond reproach...I think NOT. People who live in glass houses shouldn't throw rocks. There is no one in these forums who i would call stellar in their behavior and the vast nmmajority I would say are far WORSE.

    Skip
    ASSUME NOTHING!!!!!!
    CBE, MBE, MoA and proud of it.
    Outta here

    Billy Video
    DVD Profiler Unlimited RegistrantStar ContributorWinston Smith
    Don't be discommodious
    Registered: March 13, 2007
    United States Posts: 21,610
    Posted:
    PM this userEmail this userView this user's DVD collectionDirect link to this postReply with quote
    Quoting Nadja:
    Quote:
    Quoting skipnet50:
    Quote:
    Youi know I wasn't going to respond here, but Mathias I find your insunuation bot insulting and disgusting. GO TAKE A HIKE.               If I w3ere Ken I would obliterate this entire thread. What a jerk!!!!!!!!!!!!!!!!!!!!!!

    Skip


    If you were Ken, no-one would come here.

    OOOO clever, Nadja. Your behavior isn';t exactly ANYTHING to crow about.
    ASSUME NOTHING!!!!!!
    CBE, MBE, MoA and proud of it.
    Outta here

    Billy Video
        Invelos Forums->General: General Discussion Page: 1 2 3 ...10  Previous   Next