Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Python script

Name: Anonymous 2011-03-07 17:57

So I'm making a Python script that posts on Imageboards using urllib, but I am having troubles on the part that I have to specify the file.

If i just put the file path there, it'll say that there's no file. I expected that anyway.

So I'm asking the programmers here, how do I upload files to the imageboard through Python?

I tried reading the documentation of urllib 1 and 2 but I didn't found any concrete information on this.

Name: Anonymous 2011-03-07 18:02

Don't be a fag, use curl

Name: Anonymous 2011-03-07 18:08

I assume you're on winders.
Use forward slashes in the path

Name: OP 2011-03-07 18:17

>>3
Didn't worked...

Name: Anonymous 2011-03-07 18:19

>>4
>Didn't work.
fix'd

Name: Anonymous 2011-03-07 18:26

Don't all imageboards have captcha nowadays? You are actually writing a textboard spamming script, aren't you? Cheeky monkey.

Name: Anonymous 2011-03-07 18:36

>>6
I was trying to program my own xchan image dumper. And I know there is a way to retrieve the captcha and type it in the program, so you can post anyway.

Name: Anonymous 2011-03-07 18:55

You are in need of a better understanding of the HTTP protocol. I can tell.

Name: Anonymous 2011-03-07 19:52

>>8
So, what do you recommend for me to learn?

Name: Anonymous 2011-03-07 20:20

Name: Anonymous 2011-03-07 21:00

>>10
Look, I don't want to be an expert on the HTTP protocol, I just want to know the necessary by now. Read all this information would be exaggeration, I prefer learning by practice. When I have to do something I don't know how to, I go there and search for it, you know? That's what I'm doing by asking a question here.

Name: Anonymous 2011-03-08 3:28

>>11
Oh goodie, a right-brainer.
You really ought to know a bit about HTTP and form encoding, in particular multipart/form-data, or you won't know what to look for in a library or how to use it when you've found it.
That said, you should be able to use rfc2388.py from http://bugs.python.org/issue3244, or any of the other recipes you'll find if you search for them.

Name: Anonymous 2011-03-08 4:10

If i just put the file path there, it'll say that there's no file.
what? where? how? what exactly did you try? how the fuck are we supposed to help you? what the fuck is this? /halp/?

don't bother though because:

I prefer learning by practice.
Seems to me like you're learning by asking for the answers.
No shame in that, but take it to StackOverflow!

ps: sage your shit

Don't change these.
Name: Email:
Entire Thread Thread List