Page 1 of 1

Log in to forum and make a post to topic x

Posted: Sun Oct 17, 2021 11:10 am
by StarWarsFan
I am thinking how this would be possible, let me sort my thoughts for this request.

Let a PureBasic program...
- login to forum (My own forum runs on SMF, example: www.simplemachines.org/community/index.php)
with login and password
- Make a post to a specified thread (i.e. let the program execute .../index.php?action=post;topic=x)
where x is a simple integer indicating the topic number
a subject must be filled in and a body message too


Is that doable in PB? Has anybody done that yet?

// Moved to "General Discussion" (Kiffi)

Re: Log in to forum and make a post to topic x

Posted: Tue Oct 19, 2021 6:34 pm
by Kwai chang caine
Hello StarWarsFan
Obviously it is possible, there are also several examples of connection on the site of PB and filling of fields in JS or other methods :wink:
In a nutshell, you want to create in PB, exactly what FRED and his moderators fight every day to keep us a clean forum. :mrgreen:

Re: Log in to forum and make a post to topic x

Posted: Mon Oct 25, 2021 10:50 am
by StarWarsFan
I am sorry. That has not been my intention. Instead I said I want to run that on my *OWN* forum.

On the other hand such a response is useless and worthless because it leaves me with absolulely nothing in my hands. Can you not at least give me a link where I could continue my search if it is all so easy and already there as you claim?

And several examples? Are you serious? I have found NONE that work. ZERO! All I found in the last hours of searching: broken links from 2003, code that does not work, pseudo-intellectual lecturing, arrogant comments or recommendations about books to read, maybe this, try that, or perhaps the other, but not one piece of code that actually does what it should or what I could use as basis to evolve my code upon.

And before the typic arro-gant-ass-hole-attitude-response comes like "Do you expect us to do everything for you" - NO, FFS, NO! I have never said that, neither have I ever demanded that. But just *something* that works, some bit more than this nothingness would really do!


You know what? Scratch the request.

@ADMIN: remove this thread.

Re: Log in to forum and make a post to topic x

Posted: Mon Oct 25, 2021 11:07 am
by Rinzwind
Stop drinking, it makes you agressive.

Re: Log in to forum and make a post to topic x

Posted: Mon Oct 25, 2021 5:51 pm
by infratec
Serious :?:

You want a 100% exact answer to your first post ?

Yes and yes.

Because you asked:
Is that doable in PB? Has anybody done that yet?
And your answer to KCC is below the belt.

Re: Log in to forum and make a post to topic x

Posted: Mon Oct 25, 2021 6:19 pm
by luis
Probably this is not what you want
viewtopic.php?f=13&t=45907
and the code does not work because the page has changed, but you can get some ideas or laugh at it and move on.

The problem on doing this by yourself in code, posting through a connection is you have to support HTTPS, and I don't remember seeing code doing that in the forum, but maybe I've missed it.

Yep, KCC comment was ridiculously defensive but yours was exceedingly aggressive don't you think ?

edit: I found this -> http://forums.purebasic.com/english/vie ... hp?t=69628

Have you tried searching for libcurl ?

Re: Log in to forum and make a post to topic x

Posted: Mon Oct 25, 2021 8:21 pm
by infratec
To give you an idea:

viewtopic.php?p=512799#p512799

Most of them is now doable with HTTPRequest()

Re: Log in to forum and make a post to topic x

Posted: Mon Oct 25, 2021 11:19 pm
by Bitblazer
You can just trace what a browser does by using a proxy or Wireshark and then imitate that with httprequest. That is a shortcut to reading a few RFC's.

Re: Log in to forum and make a post to topic x

Posted: Tue Oct 26, 2021 12:18 pm
by NicTheQuick
Bitblazer wrote: Mon Oct 25, 2021 11:19 pm You can just trace what a browser does by using a proxy or Wireshark and then imitate that with httprequest. That is a shortcut to reading a few RFC's.
Or you just open the developer console of your browser and record everything that happens between you and the server. Proxies and Wireshark won't help you with encrypted data.

Re: Log in to forum and make a post to topic x

Posted: Tue Oct 26, 2021 12:24 pm
by NicTheQuick
@StarWarsFan: Do you know if your forum has an API?

Re: Log in to forum and make a post to topic x

Posted: Tue Oct 26, 2021 12:31 pm
by BarryG

Re: Log in to forum and make a post to topic x

Posted: Wed Oct 27, 2021 4:57 am
by idle
@StarWarsFan: You can edit your own post, there is no need to delete the whole thread and you might want some more help with the implementation.

From what I see you have received many good answers.
Everyone can have a bad day but it doesn't pay to take out your frustration on the forum or bite the hands that feeds you. And it's best not to misinterpret what others say here as English is often a second language here.