News:

Wondering if this will always be free?  See why free is better.

Main Menu

Automate publications

Started by Hysst, September 29, 2023, 04:17:09 AM

Previous topic - Next topic

Hysst

Hello,

I am trying to create a bot or simply automate the uploading of posts to my forum.

At the moment I don't really know how to start or where to start because I see that SMF doesn't have an API as such to help me with this and I don't know if any other user has already achieved this or knows of any API that has already been created for this purpose.

I appreciate your help in advance and I look forward to your answers.

Kindred

Well, if you write your bot in php, then you can use the functions in SSI.php.

The old API that was written for smf is deprecated at this point and no one was interested enough to modernize it
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hysst

Quote from: Kindred on September 29, 2023, 06:46:37 AMWell, if you write your bot in php, then you can use the functions in SSI.php.

The old API that was written for smf is deprecated at this point and no one was interested enough to modernize it
Yes, my idea is to do it in PHP.
Could you give me a little more information about this file you indicate?

It would be nice to know which functions are predefined to try to do what I'm looking for or if I would have to build them myself.

Kindred

Look at yoursite.com/ssi_examples.php

Or just start scrolling through the code in SSI.php on your server.

I don't think that ssi allows creating a post... but by loading sdi, you can then call for the standard smf files/functions like createPost
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hysst

Quote from: Kindred on September 29, 2023, 06:57:34 AMLook at yoursite.com/ssi_examples.php [nofollow]

Or just start scrolling through the code in SSI.php on your server.

I don't think that ssi allows creating a post... but by loading sdi, you can then call for the standard smf files/functions like createPost
If it doesn't allow you to create posts I'm back to square one....
I've seen some forums with SMF that had automated posts and that's why I was curious...
I think it's going to be a lot more complex than I imagined.

Doug Heffernan

Quote from: Hysst on September 29, 2023, 07:12:44 AMI've seen some forums with SMF that had automated posts and that's why I was curious...

I vaguely remember to have seen such a mod at our mods database section, but I am not really sure.

Kindred

The automated posts mods that you have seen are probably thinks like the RSS import to post mod...
Which is internal to smf, not an external service... it uses rss to pull data and then uses internal software functions to create the posts based on the contents of the rss feed
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Doug Heffernan

Quote from: Kindred on September 29, 2023, 09:00:57 AMThe automated posts mods that you have seen are probably thinks like the RSS import to post mod...
Which is internal to smf, not an external service... it uses rss to pull data and then uses internal software functions to create the posts based on the contents of the rss feed

That must have been it.

Hysst

Quote from: Kindred on September 29, 2023, 09:00:57 AMThe automated posts mods that you have seen are probably thinks like the RSS import to post mod...
Which is internal to smf, not an external service... it uses rss to pull data and then uses internal software functions to create the posts based on the contents of the rss feed
Could you tell me where I can find that mod you're talking about? So I can see what I can do with it.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

live627

Here's code to create ten topics

require_once('./SSI.php');
require_once($sourcedir . '/Subs-Post.php');
for ($i = 0; $i < 10; $i++)
{
$msgOptions = [
'body' => 'Automated Topic #' . $i,
'id' => 0,
'subject' => 'Automated Subject #' . $i,
];
$topicOptions = [
'id' => 0,
'board' => $board_ids[$i],
'mark_as_read' => false,
];
$posterOptions = [
'id' => $members[$i],
];
createPost($msgOptions, $topicOptions, $posterOptions);
$topics[$i] = $topicOptions['id'];

echo "Created topic $i\n";
}
https://github.com/live627/SMF2.1/blob/0986e7c488e3c25926420f787b17ee66ee770831/tests/env/Populate.php#L66-L85

Hysst

Quote from: live627 on September 30, 2023, 03:42:04 PMHere's code to create ten topics

require_once('./SSI.php');
require_once($sourcedir . '/Subs-Post.php');
for ($i = 0; $i < 10; $i++)
{
$msgOptions = [
'body' => 'Automated Topic #' . $i,
'id' => 0,
'subject' => 'Automated Subject #' . $i,
];
$topicOptions = [
'id' => 0,
'board' => $board_ids[$i],
'mark_as_read' => false,
];
$posterOptions = [
'id' => $members[$i],
];
createPost($msgOptions, $topicOptions, $posterOptions);
$topics[$i] = $topicOptions['id'];

echo "Created topic $i\n";
}
https://github.com/live627/SMF2.1/blob/0986e7c488e3c25926420f787b17ee66ee770831/tests/env/Populate.php#L66-L85 [nofollow]
I will try the code you have proposed to see if I can achieve my purpose with it.
Thank you!

m4z

There's also this python script, but it doesn't allow "timed" posting (and might not work with the current SMF version; haven't tested).
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Advertisement: