• Celebrating One Year of Revival!

    Come and join us in celebrating one year of GW's revival as GWF, share in some statistics and help us push towards the next twenty years! CLICK HERE

    We're also looking for suggestions for another community event we can put together that we can all enjoy! Come and give us some suggestions HERE
  • Our second year of the NFL Pick 'Em is open to join now. You can join directly here and get involved in the weekly threads over in the Picks forum.
  • If you are reading this message, congratulations! You are on the new server! You made it!!

Zell Wolf Who should the villagers lynch? (2 votes required)

Ben

Blind Guardian
Executive
Moderator
GWF Sponsor
Administrator
Badministrator
GW Elder
Messages
7,045
Are you the matrix?
We're more kind of The Grid around here, my dude.

Then one day... WolfBot got in.

I was just working on figuring out the API connections last night, and managed to get a Python script run locally to publish a post from the user (WolfBot) to a given thread_id. I'm going to share that setup with Zell, so that he can just use the API to control this instead of using HTTP POST or whatever other workaround he was.
 

Ben

Blind Guardian
Executive
Moderator
GWF Sponsor
Administrator
Badministrator
GW Elder
Messages
7,045
The real thing that should terrify you is that *I* made that post from WolfBot, not Zell, so I have unlocked the power to shitpost from any of your accounts.

Fox Tv Fire GIF by Bob's Burgers
 

Ben

Blind Guardian
Executive
Moderator
GWF Sponsor
Administrator
Badministrator
GW Elder
Messages
7,045
Can you do just one more and make shortkut say that he loves pineapple on pizza?
While within my power, nope. I'm not setting any precedent that this be used for lulz, and you asking me to do it was tantamount to just scheduling a post the really hard way.

I am excited for what we can use it for, though. I was playing around with making a UI to control game state and push updates to a thread, not so much a bot to run the game autonomously, but it's sure as hell possible.
 

Ben

Blind Guardian
Executive
Moderator
GWF Sponsor
Administrator
Badministrator
GW Elder
Messages
7,045
We don't wanna put ben out of work okay
I don't get paid to be here (in fact probably the opposite), so anything I do to facilitate you being self-sufficient just means I get to be lazy and not have to post.

I have enough shadow-ware tools deployed at my real job that I have job security. I am the system/process documentation.

Think About It GIF by Identity
 
I don't get paid to be here (in fact probably the opposite), so anything I do to facilitate you being self-sufficient just means I get to be lazy and not have to post.

I have enough shadow-ware tools deployed at my real job that I have job security. I am the system/process documentation.

Think About It GIF by Identity
Speaking of a total waste of time where I did absolutely no work, check this out

This works to stick the thread, since it changes the "sticky" attribute to "True"
Code:
def stick_thread(self):
        API_URL = f"https://gwforums.com/api/threads/{self.thread_id}"
        payload = {
            "sticky": True
        }
        return requests.post(API_URL, headers=self.headers, data=payload)

This does not unstick the thread
Code:
def unstick_thread(self):
        API_URL = f"https://gwforums.com/api/threads/{self.thread_id}"
        payload = {
            "sticky": False
        }
        return requests.post(API_URL, headers=self.headers, data=payload)

And in fact, it actually sticks the thread!

Took me two hours to solve.

It's supposedly a boolean, but False resolves to True. 1==2 resolves to True. 0 resolves to True. The only thing that apparently resolves to False is a null string.

Naturally, if you query the "sticky" flag in the thread object in XF it's value is False if the thread isn't stuck, but you can't update it directly to False. I don't know why it works but it just does okay
 

Smacktard

Connoisseur of fine video games
GWF Sponsor
GW Elder
Messages
5,657
It's supposedly a boolean, but False resolves to True. 1==2 resolves to True. The only thing that apparently resolves to "False" is a null string. Anything else resolved to True
wtf why that's the dumbest thing i've ever heard

so you could make the code:
def stick_thread(self):
API_URL = f"https://gwforums.com/api/threads/{self.thread_id}"
payload = {
"sticky": cumfart
}
return requests.post(API_URL, headers=self.headers, data=payload)
...and it would resolve to true and make the thread a sticky? WHY
 

Ben

Blind Guardian
Executive
Moderator
GWF Sponsor
Administrator
Badministrator
GW Elder
Messages
7,045
Speaking of a total waste of time where I did absolutely no work, check this out

This works to stick the thread, since it changes the "sticky" attribute to "True"
Code:
def stick_thread(self):
        API_URL = f"https://gwforums.com/api/threads/{self.thread_id}"
        payload = {
            "sticky": True
        }
        return requests.post(API_URL, headers=self.headers, data=payload)

This does not unstick the thread
Code:
def unstick_thread(self):
        API_URL = f"https://gwforums.com/api/threads/{self.thread_id}"
        payload = {
            "sticky": False
        }
        return requests.post(API_URL, headers=self.headers, data=payload)

And in fact, it actually sticks the thread!

Took me two hours to solve.

It's supposedly a boolean, but False resolves to True. 1==2 resolves to True. 0 resolves to True. The only thing that apparently resolves to False is a null string.

Naturally, if you query the "sticky" flag in the thread object in XF it's value is False if the thread isn't stuck, but you can't update it directly to False. I don't know why it works but it just does okay
Sad Season 1 Episode 1 GIF by NBC
 
Back
Top Bottom