Are there software tools for analysing forum threads?

This forum is for discussion related to the game.
Samson23
Samson23
Watcher
Samson23
Watcher
Watcher
Posts: 0
Joined: April 18, 2020

Are there software tools for analysing forum threads?

Post Post #0 (ISO) » Sat Apr 18, 2020 10:13 am

Post by Samson23 »

I have just started a Mafia style game, and my first thought is that it would be useful to have some sort of software tools that could read forum threads, and produce output such as posting rates and "who voted for who" networks. Do any such things exist? Would the use of such be considered bad sportsmanship?
User avatar
Ramcius
Ramcius
Mafia Scum
User avatar
User avatar
Ramcius
Mafia Scum
Mafia Scum
Posts: 4126
Joined: November 22, 2016

Post Post #1 (ISO) » Sun Apr 19, 2020 2:04 am

Post by Ramcius »

What the point of playing mafia then, if you want program to do all the work for you?
Samson23
Samson23
Watcher
Samson23
Watcher
Watcher
Posts: 0
Joined: April 18, 2020

Post Post #2 (ISO) » Sun Apr 19, 2020 4:26 am

Post by Samson23 »

That is a question I have not yet got an answer to. However, it seems to me that it would increase the fun if one is able to have various statistics to hand. Below is my first go at an analysis tool for my game, but it is on another forum so the xpath expersions would have to change to work here. The current output is:

How many posts has each user made:

Name 1 Name 2 Name 3 Name 4 Name 5 Name 6 Name 7 Name 8 Name 9 Name 10 Name 11 Name 12
2 7 13 7 13 6 1 11 4 6 8 3
Name 13 Name 14 Name 15 Name 16
4 5 1 1

How many votes has each user ever had:

Name 1 Name 2 Name 3 Name 4 Name 5 Name 6 Name 7 Name 8 Name 9 Name 10 Name 11 Name 12
2 1 0 2 1 3 1 2 1 1 1 1
Name 13 Name 14
1 2

I can load the output file into cytoscape and get a "who voted for who" network:

Image

As I say, this is my first game so I do not know what use this will be, but some seems likely.

Spoiler:

Code: Select all

library(xml2)
setwd("E:/hugh/games/mafia")

use_cache <- T
no_pages <- 5
page_stub <- "https://some_forum/page-"

one_thread <- data.frame(author = character(), voted = character(), date_str = character(), time_str = character())

for(page_itr in 1:no_pages) {
  uri <- paste0(page_stub, page_itr)
  print(uri)
  
  page <- read_html(uri)

  divs <- xml_find_all(page, "//div[@class='messageInfo primaryContent']")
  length(divs)
  head(divs)
  
  for(post_itr in 1:length(divs)) {
  
    author_nodeset <- xml_find_all(divs[post_itr], "div/div/span/span/a")
    length(author_nodeset)
    author_nodeset
    author_str <- xml_text(author_nodeset)
    
    voted_nodeset <- xml_find_all(divs[post_itr], "div/article/blockquote/b")
    length(voted_nodeset)
    voted_nodeset
    voted_raw <- xml_text(voted_nodeset)
    # If has Vote:, use first such instance, else first bolded text
    definatly_voted <- voted_raw[grep("[vV]ote:.*", voted_raw)]
    if(length(definatly_voted) == 1) {
      voted_str <- trimws(sub(".*vote:", "", definatly_voted[1], ignore.case = T))
    } else if(length(definatly_voted) == 0) {
      if(length(definatly_voted) == 0) {
        voted_str <- ""
      } else {
        voted_str <- trimws(sub(".*vote:", "", voted_raw[1], ignore.case = T))
      }
    } else {
      voted_str <- trimws(sub(".*vote:", "", definatly_voted[1], ignore.case = T))
    }
    
    date_nodeset <- xml_find_all(divs[post_itr], "div/div/span/a/abbr")
    length(date_nodeset)
    date_nodeset
    date_str <- xml_attr(date_nodeset, "data-datestring")
    time_str <- xml_attr(date_nodeset, "data-timestring")
    datetime_str <- paste(date_str, time_str)
    
    
    one_post <- data.frame(author = author_str, voted = voted_str, date_str = date_str, time_str = time_str)
    
    if(nrow(one_post) > 1) {
      print(paste("page", page_itr,"post",post_itr,"has",nrow(one_post)))
      print(one_post)
    }
    
    one_thread <- rbind(one_thread, one_post)
    
  }
  
}

one_thread

print(paste("postcount", nrow(one_thread)))

print(table(one_thread$author))
print(table(one_thread$voted))

one_thread$date_obj <- as.Date(one_thread$date_str,format="%b %d, %y")

last_nights_last_post <- 1
last_night_date <- one_thread[last_nights_last_post,]$date_obj

#todays_votes <- one_thread[one_thread$voted != "" & one_thread$date_obj > last_night_date,]
todays_votes <- one_thread[one_thread$voted != "" ,]

# from https://stackoverflow.com/questions/8203818/how-to-select-the-first-and-last-row-within-a-grouping-variable-in-a-data-frame
active_votes <- aggregate(todays_votes, by=list(todays_votes$author), FUN = function(x) {  last = tail(x,1) } )

print(active_votes)
print(table(active_votes$voted))

all_votes <- aggregate(date_obj ~ author + voted, one_thread[one_thread$voted != "",], FUN = length)

write.csv(all_votes, file = "all_votes.csv")

# Anonymise

levels(one_thread$author) <- paste("Name",1:16)
one_thread[one_thread$voted == "","voted"] <- NA_character_
levels(one_thread$voted) <- paste("Name", 1:14)

User avatar
Awoo
Awoo
Mafia Scum
User avatar
User avatar
Awoo
Mafia Scum
Mafia Scum
Posts: 1096
Joined: September 1, 2017
Location: lmao city

Post Post #3 (ISO) » Sun Apr 19, 2020 11:59 am

Post by Awoo »

In post 1, Ramcius wrote:What the point of playing mafia then, if you want program to do all the work for you?
Imagine doing work by hand if you could get a computer to do it for you.
samlarson
samlarson
Watcher
samlarson
Watcher
Watcher
Posts: 0
Joined: September 2, 2020

Post Post #4 (ISO) » Thu Sep 17, 2020 1:34 am

Post by samlarson »

I have just started a Mafia style game, and my first thought is that it would be useful to have some sort of software tools that could read forum threads, you should also check out this loan affiliate network https://leadnetwork.com/pay-per-lead-af ... am-network and produce output such as posting rates and "who voted for who" networks. Do any such things exist? Would the use of such be considered bad sportsmanship?
the general idea is really good but I'm with others on this one
The game is meant to be played with notebook in hand
I think its more fun that way=)
Last edited by samlarson on Wed Sep 23, 2020 1:07 am, edited 1 time in total.
User avatar
Ythan
Ythan
She
Welcome to the Haystack
User avatar
User avatar
Ythan
She
Welcome to the Haystack
Welcome to the Haystack
Posts: 15149
Joined: August 11, 2009
Pronoun: She

Post Post #5 (ISO) » Thu Sep 17, 2020 4:42 pm

Post by Ythan »

This would not hurt the game. Sounds far out also.
User avatar
the worst
the worst
Snuggly Duckling
User avatar
User avatar
the worst
Snuggly Duckling
Snuggly Duckling
Posts: 36602
Joined: November 7, 2015
Location: pond

Post Post #6 (ISO) » Sun Sep 20, 2020 12:02 pm

Post by the worst »

i know the idea of "tool assisted scumhunting" is pretty infamous (a program which actually attempts the human element of the game, e.g. parsing players' alignments) but i'd definitely say using a tool to collate very unambiguous and very public data isn't against the spirit of the game. on the contrary, it enhances the integrity of the kinds of conversations players already have to get the game moving.

egopost etc.
who's scum? i haven't read up yet but like, it's me
--
intermittent v/la until late march
User avatar
Kerset
Kerset
he/she
Mafia Scum
User avatar
User avatar
Kerset
he/she
Mafia Scum
Mafia Scum
Posts: 3415
Joined: September 5, 2019
Pronoun: he/she
Location: Europe

Post Post #7 (ISO) » Tue Sep 22, 2020 11:07 pm

Post by Kerset »

What could you possibly gather from AI? Only processed statistical data.
giv me pagetop :(
User avatar
Kerset
Kerset
he/she
Mafia Scum
User avatar
User avatar
Kerset
he/she
Mafia Scum
Mafia Scum
Posts: 3415
Joined: September 5, 2019
Pronoun: he/she
Location: Europe

Post Post #8 (ISO) » Tue Sep 22, 2020 11:07 pm

Post by Kerset »

Its fine
giv me pagetop :(
User avatar
Ramcius
Ramcius
Mafia Scum
User avatar
User avatar
Ramcius
Mafia Scum
Mafia Scum
Posts: 4126
Joined: November 22, 2016

Post Post #9 (ISO) » Wed Sep 23, 2020 4:27 am

Post by Ramcius »

What's the point in doing so? You might win more, sure, but you're abandoning spirit of the mafia, you know, the feel that YOU figured stuff, not some algorithm that you just ran. Also, it gets boring fast enough, because you putting less work in it and end result doesn't feel so rewarding
User avatar
Ythan
Ythan
She
Welcome to the Haystack
User avatar
User avatar
Ythan
She
Welcome to the Haystack
Welcome to the Haystack
Posts: 15149
Joined: August 11, 2009
Pronoun: She

Post Post #10 (ISO) » Wed Sep 23, 2020 5:18 am

Post by Ythan »

In post 9, Ramcius wrote:abandoning spirit of the mafia
Lol though
User avatar
Ramcius
Ramcius
Mafia Scum
User avatar
User avatar
Ramcius
Mafia Scum
Mafia Scum
Posts: 4126
Joined: November 22, 2016

Post Post #11 (ISO) » Wed Sep 23, 2020 6:24 am

Post by Ramcius »

In post 10, Ythan wrote:
In post 9, Ramcius wrote:abandoning spirit of the mafia
Lol though
I'm not talking about people, who see mafia games as a social gatherings, they don't care enough to even use software
User avatar
Ythan
Ythan
She
Welcome to the Haystack
User avatar
User avatar
Ythan
She
Welcome to the Haystack
Welcome to the Haystack
Posts: 15149
Joined: August 11, 2009
Pronoun: She

Post Post #12 (ISO) » Wed Sep 23, 2020 6:27 am

Post by Ythan »

The spirit of mafia is not rescanning a thread for what posts votes occurred in.
User avatar
Ramcius
Ramcius
Mafia Scum
User avatar
User avatar
Ramcius
Mafia Scum
Mafia Scum
Posts: 4126
Joined: November 22, 2016

Post Post #13 (ISO) » Wed Sep 23, 2020 6:55 am

Post by Ramcius »

In post 12, Ythan wrote:The spirit of mafia is not rescanning a thread for what posts votes occurred in.
You think that's only way software can be used in mafia? What do you think about scanning person's whole posting history looking for how many times they said something specific as either alignment?

I mean, what is described at the start of the thread is pretty useless, but there is far more applications for software in mafia
User avatar
Ythan
Ythan
She
Welcome to the Haystack
User avatar
User avatar
Ythan
She
Welcome to the Haystack
Welcome to the Haystack
Posts: 15149
Joined: August 11, 2009
Pronoun: She

Post Post #14 (ISO) » Wed Sep 23, 2020 7:03 am

Post by Ythan »

I'm becoming more confident every time we interact that talking to you is a waste of time. See you next time I forget.
User avatar
Ramcius
Ramcius
Mafia Scum
User avatar
User avatar
Ramcius
Mafia Scum
Mafia Scum
Posts: 4126
Joined: November 22, 2016

Post Post #15 (ISO) » Wed Sep 23, 2020 7:05 am

Post by Ramcius »

In post 14, Ythan wrote:I'm becoming more confident every time we interact that talking to you is a waste of time. See you next time I forget.
Ofc baiting me is a waste of time, maybe when you become medium sized troll, I might take your bait, but as a petty troll you can't provide me much entertainment
User avatar
Andycyca
Andycyca
Gets To Kill All Spammers
User avatar
User avatar
Andycyca
Gets To Kill All Spammers
Gets To Kill All Spammers
Posts: 778
Joined: July 31, 2007
Location: The Tesseract
Contact:

Post Post #16 (ISO) » Thu Sep 24, 2020 2:29 pm

Post by Andycyca »

In post 0, Samson23 wrote:it would be useful to have some sort of software tools that could read forum threads, and produce output such as posting rates and "who voted for who" networks.
Off the top of my head, this could be achieved with (pseudo-)parsers like
BeautifulSoup
and regular expressions.

You could scan for regular expressions of votes and dump them to form a
dot
file and then create a graph in
Graphviz
.

If you ask me, it's easier and faster to keep a small "summary" log in a physical notebook (I used to write: "post # -- Event" to analyze)
Planning: Katamari Damacy Mafia - Less than 50% done!

BTRAF 6 coming to a Mafia Forum near you. Now with 50% less chlorine! Bring your tin foil hat
User avatar
Cabd
Cabd
QT Sniper
User avatar
User avatar
Cabd
QT Sniper
QT Sniper
Posts: 15496
Joined: February 3, 2013

Post Post #17 (ISO) » Sat Sep 26, 2020 6:23 am

Post by Cabd »

So, iirc Psyche has an API to do this specifically for MS. I've been debating ingesting it into a BI tool and doing some analytics.
Show
Have retired for good; Life is too busy to have time or energy for mafia. It was fun~


And then, a Miracle, a Dance Game and a flight of fancy struck, one more game into the abyss
User avatar
Gamma Emerald
Gamma Emerald
Any
Survivor
User avatar
User avatar
Gamma Emerald
Any
Survivor
Survivor
Posts: 69101
Joined: August 9, 2016
Pronoun: Any
Location: Hell on Earth (aka Texas)

Post Post #18 (ISO) » Mon Oct 05, 2020 3:35 pm

Post by Gamma Emerald »

In post 9, Ramcius wrote:What's the point in doing so? You might win more, sure, but you're abandoning spirit of the mafia, you know, the feel that YOU figured stuff, not some algorithm that you just ran. Also, it gets boring fast enough, because you putting less work in it and end result doesn't feel so rewarding
What is the spirit of maifa?
<Embrace The Void>


“A flipped coin doesn't always land heads or tails. Sometimes it may never land at all...”
User avatar
Ramcius
Ramcius
Mafia Scum
User avatar
User avatar
Ramcius
Mafia Scum
Mafia Scum
Posts: 4126
Joined: November 22, 2016

Post Post #19 (ISO) » Tue Oct 06, 2020 3:49 am

Post by Ramcius »

In post 18, Gamma Emerald wrote:
In post 9, Ramcius wrote:What's the point in doing so? You might win more, sure, but you're abandoning spirit of the mafia, you know, the feel that YOU figured stuff, not some algorithm that you just ran. Also, it gets boring fast enough, because you putting less work in it and end result doesn't feel so rewarding
What is the spirit of maifa?
Usage of your own head to solve game
Tact is for liars and politicians.
User avatar
the worst
the worst
Snuggly Duckling
User avatar
User avatar
the worst
Snuggly Duckling
Snuggly Duckling
Posts: 36602
Joined: November 7, 2015
Location: pond

Post Post #20 (ISO) » Tue Oct 06, 2020 3:56 am

Post by the worst »

Image
i am the spirit of mafia
who's scum? i haven't read up yet but like, it's me
--
intermittent v/la until late march
User avatar
Andycyca
Andycyca
Gets To Kill All Spammers
User avatar
User avatar
Andycyca
Gets To Kill All Spammers
Gets To Kill All Spammers
Posts: 778
Joined: July 31, 2007
Location: The Tesseract
Contact:

Post Post #21 (ISO) » Tue Oct 06, 2020 4:06 am

Post by Andycyca »

I'm the oldest account in this thread yet. Does that make me the spirit of Mafia Past?
Planning: Katamari Damacy Mafia - Less than 50% done!

BTRAF 6 coming to a Mafia Forum near you. Now with 50% less chlorine! Bring your tin foil hat
User avatar
Ramcius
Ramcius
Mafia Scum
User avatar
User avatar
Ramcius
Mafia Scum
Mafia Scum
Posts: 4126
Joined: November 22, 2016

Post Post #22 (ISO) » Tue Oct 06, 2020 4:17 am

Post by Ramcius »

I'll just make myself clear on this - any software that helps you analyse is broken and shouldn't be used, I mean real analyse, you give info and software gives you answer based on some algorithm. Software that helps to keep track of things is fine, but let's be real, that kind of software is borderline useless, even if you find scum with help of it, you can't convince other players, it simply wouldn't be enough of an argument.
Tact is for liars and politicians.
User avatar
Ythan
Ythan
She
Welcome to the Haystack
User avatar
User avatar
Ythan
She
Welcome to the Haystack
Welcome to the Haystack
Posts: 15149
Joined: August 11, 2009
Pronoun: She

Post Post #23 (ISO) » Tue Oct 06, 2020 4:57 am

Post by Ythan »

Yeah you're definitely completely wrong about this.
User avatar
Cabd
Cabd
QT Sniper
User avatar
User avatar
Cabd
QT Sniper
QT Sniper
Posts: 15496
Joined: February 3, 2013

Post Post #24 (ISO) » Tue Oct 06, 2020 5:04 am

Post by Cabd »

Software like that should be seen as a great equalizer.
Show
Have retired for good; Life is too busy to have time or energy for mafia. It was fun~


And then, a Miracle, a Dance Game and a flight of fancy struck, one more game into the abyss
Post Reply

Return to “Mafia Discussion”