Logging in and posting - with Java

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
prodigy84
Registered User
Posts: 4
Joined: Sun Mar 04, 2018 1:59 pm

Logging in and posting - with Java

Post by prodigy84 » Wed May 09, 2018 12:47 am

Hi all,

I've attempted searching this and haven't come up with anything pertinent to my issue.

Basically, I have a Java written program that helps me with many aspects of maintaining and updating content on my website. One thing it does is write phpbb forum code to a text document on my desktop. I then login to the phpbb forum with my main username, "prodigy", find the correct thread and post the contents of the text document into the forum post and submit it.

My dream is to have this behavior automated.
- Instead of writing to the text document, the Java program should:
-- Connect to phpbb forum and login with the username "prodigy"
-- Choose the correct forum, "Forum 1" (not "Forum 2")
-- Search for a thread in this forum with the thread title given by the user in the Java GUI.
--- If thread title is found, open that thread, reply with given forum code, and submit reply
---- *Note* It likely does this already.. but just to note.. the post reply should appear last after submitting

Any help on this will be greatly appreciated. If you know of any help documents for this, I'd love to read them.

Perhaps, it's best to take it one thing at a time. How does one connect to the phpbb forum and login with a certain username, using Java?

Thanks for your help. If I can get this working, it would be the greatest thing ever (for me).

User avatar
AmigoJack
Registered User
Posts: 5332
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Logging in and posting - with Java

Post by AmigoJack » Wed May 09, 2018 10:48 am

prodigy84 wrote:
Wed May 09, 2018 12:47 am
How does one connect to the phpbb forum
Just like with any other internet resource: via HTTP.

prodigy84 wrote:
Wed May 09, 2018 12:47 am
login with a certain username, using Java?
The language is irrelevant: you perform a HTTP POST using the parameters for the login FORM, plus sending the cookies you received on your initial GET, of course.

You basically want to learn how to "download" one internet page. Then you want to learn why you did that via a GET request and why HTTP also offers POST requests. Then you're about to parse what you downloaded to either see if you're indeed logged in, or what your board search query returned. At the end you most likely want to capture the whole HTTP communication (from calling the board index thru logging in up to seeing search results) to see what is sent and what is received, which Chrome-like browsers are already capable of.
The worst thing about censorship is ███████████

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 4 guests