/halp/ - LynxChan technical assistance

General support

Mode: Reply
Name
Subject
Message

Max message length: 4096

Files

Max file size: 1.00 MB

Max files: 3

E-mail
Password

(used to delete files and postings)

Misc

Remember to follow the rules


Posting from a script Anonymous 07/01/2019 (Mon) 20:48:37 No. 850
How to use a python script to post on Lynxchan?
Standard http requests.
I'm posting this data:

data = {'action': '/replyThread.js', 'boardUri': 'int', 'threadId': '3655179', 'message': 'BUMP#1001', 'subject': ''}

with this header:

header = {'Content-Type': 'form-data'}

At this url:

r = session.post("https://kohlchan.net/" + "replyThread.js?json=1", headers = headers, data = data)

I get code 200 (ok) but it doesn't display the post in this thread.


>>852
Yea, thanks for the effort.
>>858
Try to add files = data for post()
>>859
Thank you very much, it helped a lot!
But then, what to do to upload files, please?
data = {'boardUri': board, 'threadId': threadId, 'message': message, 'subject': subject, 'sage': sage, 'spoiler': spoiler}

data['file_0'] = open("C:\\Users\\MRX\\Documents\\py_scripts\\pics\\prog\\meme\\that_hacker_feel.png", 'rb')

and then

r = requests.post(website + "replyThread.js?json=1", data = data, files = data)

doesn't seem to work for instance
>>881
I haven't succeeded after a good amount of tests:

#image = {'fileMd5': fileMd5, 'fileMime':'image/png', 'fileSpoiler':"", 'fileName':'that_hacker_feel.png', 'files': ['filename="that_hacker_feel.png"', file_0]}
#image = {'files': ["that_hacker_feel.png", file_0, 'image/png']}
#image = {'files': ["that_hacker_feel.png", file_0, 'image/png', {'fileMd5': fileMd5, 'fileMime':'image/png', 'fileSpoiler':"", 'fileName':'that_hacker_feel.png'}]}
#image = {'files': ["that_hacker_feel.png", file_0, 'image/png', {'fileSpoiler':""}]}
image = {'files': ["that_hacker_feel.png", file_0]}
(16.55 KB 480x270 Konata-izumi-smug.jpg)
(114.78 KB 372x350 smug.png)
>data['file_0'] = open("C:\\Users\\MRX\\Documents\\py_scripts\\pics\\prog\\meme\\that_hacker_feel.png", 'rb')
>C:
Jolly gee, I wonder why you can't figure somehing basic like this out.
>>887
haha linux is an OS fro good programmers.
Oh wow.
Great joge.
>>888
Not necessarily, it's just that people who are bad with cumpootah uses windows.
>>891
Just post the solution to file upload already if you are so good.
REEEEEE xD
(201.25 KB 516x526 cd0.jpg)
Come funpost at https://spacechan.xyz/b/
>>898
>>852
I am not shitting you, just look at the posting forms. It's extremely basic.
>>899
no thx
>>900
from the posting form, I get it's about the name "files".
Then it may be an array of files, not sure what's going on exactly, I try a combination of those. >>886

Delete
Report/Ban

Captcha (required for reports and bans by board staff)


no cookies?