Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - O.Wilde

Pages: 1 ... 21 22 [23] 24 25 ... 37
331
General Discussion / Re: Bay12_SS: The Shitpost Simulator.
« on: January 30, 2016, 11:49:41 pm »
So for all of you wonderful people out there wanting a Loud Whisper Official Posts Authentically Datamined Textfile of Words, here ya go. It took friggin forever even with the scraper (It's 15 fucking megabytes holy shit), but here's 32,000 posts worth of distilled LW. 200 proof.

The weirdest textfile you ever did see. (It's on tinyupload cause it's too big for pastebin)

Side Note: I am actually ridiculously proud of the scraper, having never programmed a working thing in my life beyond a simple calculator. It's a work of art. Even if it is likely horrible optimization wise.

If you want to use the scraper, I'll post the code below. It requires the following:
requests (Can be downloaded through pip)
BeautifulSoup 4 (Also pip)
lxml (Ditto)

I take no responcibility for anything this does to your computer, blah blah blah, use at your own risk, try to not crash any websites. It's commented, but only as far as I understand it. It's likely that some comments are entirely wrong and show a fundamental misunderstanding of everything.

Code: [Select]
############ O.Wilde's Bay 12 Scraper ############
################## V.1 1/30/16 ##################

import requests
import bs4
import lxml
import re
from html.parser import HTMLParser

###########################################################################

def findprofile(profilepage):
    print ('Finding pages to scrape...')
    user = re.sub('http://www.bay12forums.com/smf/index.php?action=profile;u=', '', profilepage) #Removes everything but the user ID number from the  profile link
    url = 'http://www.bay12forums.com/smf/index.php?action=profile;area=showposts;sa=messages;u=' + user #Adds the User ID number obtained in the last step to navigate to their messages page.
    return (url)

def scrapeposts(url):
    page = requests.get(url)
    soup = bs4.BeautifulSoup(page.text, "lxml") #Takes the text of the HTML contained on the URL messages page and makes is usable for our purposes
    data = [a.attrs.get('href') for a in soup.select('div.pagesection a.navPages')] #Selects the data contained in our HTML [a class="navpages"...../div] tags, which is the entirety of the posts listed.
    ppg = re.sub('http(.+?)start=', '', data[0]) #Finds the number of posts per page
    tp = re.sub('http(.+?)start=', '', data[len(data)-1]) #Finds the postnumber that the final page of posts starts on
    pagenumber = (int(tp) / int(ppg)) + 1 #Finds the total number of pages of posts
    counter = 0
    page = 0
    scrapedata = ''
    while counter < pagenumber: #While the page we are working on is less than the total number of pages
        counter = counter + 1 #Add 1 to the counter
        print ('Now scraping page ' + str(counter) + ' out of ' + str(pagenumber) + '!')
        scrapeurl = url + 'start=' + str(((counter - 1) * 15)) #Goes to the url of the page of posts
        scrapepage = requests.get(scrapeurl)
        scrapesoup = bs4.BeautifulSoup(scrapepage.text, "lxml") #Takes the text of the HTML contained on the URL messages page and makes is usable for our purposes
        scrapetext = soup.select('div.list_posts') #Selects the data contained in our HTML that we want to mine. Specifically, the posts on the page
        scrapedata = scrapedata + ' ' + str(scrapetext) #Adds our freshly scraped data to the string of scraped data mined so far.
    print ('Done!')
    return(scrapedata)

def cleardata(data):
    print('Removing HTML...')
    cleareddata = re.sub('<[^<]+?>', ' ', str(data)) #Removes all strings contained within <...>, this is to remove HTML tags. Replaces with a space.
    print('Removing Quote Tags...')
    cleareddata1 = re.sub("Quote(.+)pm", ' ', cleareddata) #Removes quote tags ending in PM and replaces with a space
    cleareddata2 = re.sub("Quote(.+)am", ' ', cleareddata1) #Same as above, but for am. (I could do this in one step, but I don't know how.)
    print('Removing Tabs...')
    cleareddata3 = re.sub('[\s+]', ' ', cleareddata2) #Removes any extra tabs, replaces with spaces
    print('Removing Non-ASCII Data...')
    cleareddata4 = re.sub(r'[^\x00-\x7F]',' ', cleareddata3) #Removes any non-ascii characters so textfile can be created.
    print('Removing Spaces...')
    cleareddata5 = re.sub(r'\s+', ' ', cleareddata4) #Removes the clutter of spaces created from the previous few steps, replacing them with a single space each.
    return (cleareddata5)

def writefile(data, name):
    print('Writing File...')
    file = open(name + '.txt', 'w') #Creates a new file in which to save our data
    file.write(data) #Writes our data to the file
    file.close #Closes the file
    input('Posts have been scraped, and file created. Thank you for using the Bay 12 Scraper by O.Wilde!')

###########################################################################
   
url = findprofile(input("Please input the profile of the member who's posts you would like to scrape: ")) #Asks for a profile link to scrape, and calls findprofile using that link. Sets url equal to the returned value
messydata = scrapeposts(url)
cleandata = cleardata(messydata)
writefile(cleandata, input('Please input the name of the text file you want to be generated. WARNING: Any file with the same name will be overwritten!!!: '))

332
PTW


Extend

333
Pfahahahah oh I'm fucked.

334
General Discussion / Re: Bay12_SS: The Shitpost Simulator.
« on: January 30, 2016, 07:06:21 pm »
I am so sorry I brought this up, let's not clutter the thread with it.

In other news, the B12 scraper is progressing interestingly. I have a feeling this is gonna be really entertaining.

335
His followers could not see their face, but they knew Kazzlar grinned. It coursed through them, twisted and cruel.

Free Action (Wanderer: Soul Steal): Suddenly, Kazzlar motioned to the Wanderer, commanding it to leave through the main doors. It was going, looking for Souls. It was to touch anyone it came across, consuming them.

Free Action (Mind Control): Kazzlar brought the five strongest of his followers close to him, reaching his hands out towards them, commanding them to go into the world, obtain 'volunteers', and bring them back.

Free Action (Inflict Horror): Kazzlar touched one of his followers, breaking his mind with terror.

Free Action (Mind Warp): Every follower around Kazzlar began to feel more and more corrupted, as his tendrils of twisted power touch all of them.

4 Fear (Draw Followers): People feel drawn to the offices as Kazzlar increases his pull.

3 Fear (Inflict Fear): Terror ran through the building, and those around it, as Kazzlar's corruption spread.


336
Also, I don't think my fear counter is right. I spent 12 fear the first turn, but ended it with 6 fear remaining. I'm assuming this is the fear I gained from my induce fear action? However, my Accumulated Fear is only at 2. Additionally, next turn I am up to 7 fear, and my AF is at 3. What's my current fear score, please?

337
So, since I don't dictate if I find people or not through teleportation, can I submit 2 sets of actions based on whether I do end up in a populated place or not?

338
Forum Games and Roleplaying / Re: Bay 12 Inn
« on: January 30, 2016, 04:27:39 am »
I'd say it was a good run, but it was not.

339
Use Weed

If that's a free action, and I can also attack, finish Bob off!

340
Mafia / Re: Big Top Mafia (9/9) Act-1 Well we need a new finale
« on: January 30, 2016, 02:09:23 am »
Just a note, fillipk is offline till Sunday.

341
Forum Games and Roleplaying / Interest Check - Puzzle Series
« on: January 30, 2016, 01:40:47 am »
So, I'm thinking of running a series of games with a set objective, that can be accomplished through critical thinking, exploration, and some weird research and stuff. So, for example, give you a (fictional) user manual to the engine room of a ship, and have you try to get it working again. The challenge being wading through obscure text, reference numbers, missing sections, confusing instructions, and outdated terminology. The games would last until the puzzle was solved, or until you got stuck. Now, before I start really working on this, I have a few questions.

1: Would anyone be interested in playing?
2: What setting would you like the first game to take place in? (Sci-fi, modern, historical, ect.)
3: What types of challenges would you like to see, and what do you want left out? (For instance, would anyone be interested in solving a simple (or not) cypher, or a mathematical equation)
4: Anything else you want to say, suggestions, questions, ect?

342
Mafia / Re: Mafia Marathon (Semi-bastard)
« on: January 30, 2016, 01:27:29 am »
PTW

343
Roll To Dodge / Re: Roll to Ski (0/infinity)
« on: January 30, 2016, 01:25:11 am »
South headwall! This is definitely a good plan! "Wall" is probably just an expression!
Approximately 3 seconds after you make this decision, you find it is most definitely not an expression. [1] -> [5] You catch an edge right at the top, and spend about 30 seconds tumbling head over heels over and over and over until you end up in a small pile of fluffy snow at the bottom of the wall. Everything hurts, there's snow in your coat, life is hell. You can proceed to South Basin or 100's.

Assail skiers on Parry's Peak
[4] You zoom off the lift, immediately shoving over a helpless skier. Parry's Peek whistles past you as you go, aiming for the person in front of you. [3] A quick slap with your poles and she's sent flying head over heels, buried in powder. [6] -> [6] -> [4] Your righteous attack on the skier has attracted attention. Specifically, an absolute horde of snowboarders and skiers have joined with you, terrorizing Parry's Peek. There's 13 of them. You reach a crossroads, and they look to you for guidance.

Kinnikinnic, Willett's Way, Johnstone Junction
, or continue on Parry's Peek?

Begin sabotaging ski lifts and snapping skis. When caught, ski down the Vasquez Cirque Access!
[2] You don't even manage to snap a single ski before an employee spots you and shouts at you to stop! You head for the Cirque. [2] Unfortunately, you miss the turn and end up on Village Way. Looking behind you, [3] it looks like only one person is following, and they seem to be losing ground. You can continue down Larkspur, Sky Pilot, Village Way, or Belle Fourche.

Spoiler: Characters (click to show/hide)

344
Forum Games and Roleplaying / Re: Foundations of Government (OOC)
« on: January 29, 2016, 11:29:11 pm »
Sorry, this game generates too many walls of text for me to keep up. In the event that I'm still in, Out.

345
General Discussion / Re: Bay12_SS: The Shitpost Simulator.
« on: January 29, 2016, 11:27:10 pm »
Oooo, now I wanna make roobot.

For those of you out of the know, roo is a player on the Mafia forums who posts garbage constantly, almost never replies to questions, and just tends to do whatever he wants randomly. It might actually be less infuriating to play with the bot than the person.

Pages: 1 ... 21 22 [23] 24 25 ... 37