Author Topic: I need some programming help  (Read 318 times)

0 Members and 1 Guest are viewing this topic.

Offline PANTS!

  • One leg at a time.
  • Reef Tank Owner
  • *********
  • Posts: 8762
  • What seals? I auditioned for this job.
I need some programming help
« on: March 31, 2017, 06:58:46 PM »
I am doing some programming in Python; trying to post to a forum that we all love.

I am using the Python library Requests.

Using Fiddle, I can see the POST data, but it looks weird.   It looks like a multipart form, I think? 

example:

Name                                                                      Value
Content-Disposition: form-data; name="topic"      43187

How can I encode that weird WebForm attribute?  Any ideas?  Been poking at it for about a day now.
« Last Edit: March 31, 2017, 07:28:32 PM by PANTS! »
Now where I come from
We don't let society tell us how it's supposed to be
-Uptown, Prince 👉

We cross our bridges when we come to them and burn them behind us, with nothing to show for our progress except a memory of the smell of smoke, and a presumption that once our eyes watered.

Offline Andrew Clunn

  • Poster of Extraordinary Magnitude
  • **********
  • Posts: 15016
  • Aspiring Super Villain
Re: I need some programming help
« Reply #1 on: March 31, 2017, 08:24:47 PM »
Gonna hop on a PC and check this out.
Banned from both Hacker News and the xkcd forum.

Offline Andrew Clunn

  • Poster of Extraordinary Magnitude
  • **********
  • Posts: 15016
  • Aspiring Super Villain
Re: I need some programming help
« Reply #2 on: March 31, 2017, 08:30:15 PM »
This is a test

EDIT -
Further testing.
« Last Edit: March 31, 2017, 08:33:53 PM by Andrew Clunn »
Banned from both Hacker News and the xkcd forum.

Offline Andrew Clunn

  • Poster of Extraordinary Magnitude
  • **********
  • Posts: 15016
  • Aspiring Super Villain
Re: I need some programming help
« Reply #3 on: March 31, 2017, 08:39:46 PM »
Try using the modify post as a base and submitting the data with the XML flag in the url like so:

http://sguforums.com/index.php?action=jsmodify;topic=TOPIC_NUMBER;fb51260191be=UNIQUE_USER_TOKEN;xml

subject="THE_NAME_OF_THE_SUBJECT_IN_THE_REPLY"&message=CONTENT_OF_THE_MESSAGE&topic=TOPIC_NUMBER&msg=MESSAGE_NUMBER
Banned from both Hacker News and the xkcd forum.

Offline PANTS!

  • One leg at a time.
  • Reef Tank Owner
  • *********
  • Posts: 8762
  • What seals? I auditioned for this job.
Re: I need some programming help
« Reply #4 on: March 31, 2017, 09:33:29 PM »
Roger - will do.

Data is so much easier.   :laugh:
Now where I come from
We don't let society tell us how it's supposed to be
-Uptown, Prince 👉

We cross our bridges when we come to them and burn them behind us, with nothing to show for our progress except a memory of the smell of smoke, and a presumption that once our eyes watered.

Offline PANTS!

  • One leg at a time.
  • Reef Tank Owner
  • *********
  • Posts: 8762
  • What seals? I auditioned for this job.
Re: I need some programming help
« Reply #5 on: April 11, 2017, 09:39:10 AM »
Turns out if you create a session object, you should continue to use it if you don't want to have to log on again.   ::)  :laugh:
Now where I come from
We don't let society tell us how it's supposed to be
-Uptown, Prince 👉

We cross our bridges when we come to them and burn them behind us, with nothing to show for our progress except a memory of the smell of smoke, and a presumption that once our eyes watered.

Online Johnny Slick

  • "Goddammit, Slick."
  • Poster of Extraordinary Magnitude
  • **********
  • Posts: 11887
  • Fake Ass Skeptic
Re: I need some programming help
« Reply #6 on: April 11, 2017, 05:01:08 PM »
Turns out if you create a session object, you should continue to use it if you don't want to have to log on again.   ::)  :laugh:
A lot of frameworks kind of include this on their own on the client side so you don't have to manage it so much, so there's good news there at least. On the other hand, so far as I can tell there is no good way to know when a session timeout is going to occur other than knowing in advance how long timeouts last on your server, whether or not they roll, and using a timer on the client side to track when they're about to expire so users don't, like, try to input a whole bunch of data that just goes away. The program we're making REST calls to *does* seem to have the session expiration time available in a cookie so... you still have to load the cookie, convert the time from C++ time to real time, and go from there but it's *kind* of doable? In theory?
Speak what you think now in hard words, and to-morrow speak what to-morrow thinks in hard words again, though it contradict every thing you said to-day.

- Ralph Waldo Emerson

 

personate-rain