Seeding a new forum by creating users and content

Hi there

Discourse looks amazing. Wow! A big change from my old days using phpbb.

In the past, admittedly a long time ago now, I’ve had greater success starting new forums by initially seeding some content. A little social proof does wonders for engagement levels!

Would love to know whether it is possible to seed a new discourse forum. What I’d like to do is to create say 200 user accounts and roughly 1000 topics and replies before launching.

Is it possible to do this without having either 200 email addresses or 200 social accounts?

I’d like to add these users from the admin panel and log in to them occasionally to respond to new users.

Many thanks

Joe

1 Like

You can write yourself a script for that using API :wink:

2 Likes

Seems disingenuous, but you can create multiple users with a single email account by using email addresses like this:

  • my.gmail.username@gmail.com
  • my.gmail.username+user1@gmail.com
  • my.gmail.username+joe@gmail.com
  • my.gmail.username+funnyguy@gmail.com
  • my.gmail.username+smartypants@gmail.com
  • my.gmail.username+guyWeHate@gmail.com

and so on. Most email systems support this convention.

There’s a bulk import feature, so you could create them all in a spreadsheet or whatever.

The API is a great took but you might also put the content in some database and write an importer to populate Discourse. See vanilla.rb and vanilla_mysql.db for examples. I just wrote an importer to import an image gallery. I thought it was a bad idea at first, because it would seem like an image gallery would be a good way to display an image gallery. But it turns out that the image gallery in Discourse is pretty freaking great.

5 Likes

Hi Sergiz and Jay

Thank you both for these suggestions.

I’m not a coder, so I’d probably look at doing things your way Jay.

Certainly not trying to be disingenuous, but I think it’s important to get the ball rolling with some posts. That way, others are more likely to join in.

Once again, many thanks.

Joe

If you already have the 1000 posts and 200 usernames created in some machine-readable format it would probably be worth a few minutes to look at how the API works and/or paying someone to do it for you, but then, I’m a programmer, so I would think that. Or course, I’d rather spend 20 hours writing code than 10 copy-and-pasting, because what if you ever needed to do it again?

4 Likes

Hey Joe,
You’re definitely right about social proof, but creating fake users is questionable practice and I’d strongly recommend against it, for the long term health of your community. There are more ethical ways of doing it (which won’t result in a backlash). If you want some advice around doing things differently, I’m happy to help.

Here is further reading.

10 Likes

Hi @HAWK

I think you make a really great point.

I read your article and it makes a lot of sense. Developing a community the right way might take a bit longer but I think it will be better in the long run.

You have turned me around. I think my thinking is a little 2009.

Once again, many thanks

Joe

6 Likes

Heh, awesome. Good on you. :slight_smile:

4 Likes

Hi @HAWK

Thanks so much for that. I will take you up on that offer to join your community as well if that’s okay. That’s really cool. Thanks!

And to everyone else who helped out, much respect. Thank you.

Cheers

Joe

4 Likes

I don’t think this is possible as the posts section in api doesn’t have user id.
http://docs.discourse.org/#tag/Posts
How to tag response with an user? @pfaffman

I cannot imagine that the API for posts doesn’t include the userid. Perhaps the documentation is wrong. There is a post about reverse engineering the API that might help,

1 Like

Can you point out the link here? Will check it out!

I’m fairly certain it doesn’t. It takes it from the API userid and API key.

I just checked with one of my apps and I’m not passing a Username when creating a reply.
https://github.com/discourse/github-issues-to-discourse/blob/master/routes/api/discourse.js#L68-L73

Same with creating a topic:
https://github.com/discourse/github-issues-to-discourse/blob/master/lib/discourseCreateTopic/index.js

The only username it will have is based on the API username and key I provide.

Ha! Now I get it. I guess I need a better imagination. Thanks, @cpradio.

So it would seem that the way to create seed data with many users would be to modify an import script. It’s probably easiest to get your data into MBOX form and use the mbox importer.

1 Like

It doesn’t seem to be in the API docs, but there is a POST endpoint for

/t/{id}/change-owner

which seems to take two parameters

{
post_ids[]:{post-id-to-change},
username:{user-to-change-ownership-to}
}

(I found that by watching my chrome dev tools while clicking the “change ownership” button on a post)

Maybe you use that to create posts using one user, then change their owner.

3 Likes

Two notes:

  • post_ids[] is a comma-separated array, you can do multiple
  • doing this creates a revision on the post

It’s better to do an import script.

4 Likes

anyone had luck creating this importer? I have the topics and answers in excel. would like to create threads with different users

It’s reasonably easy to push them in with the API, especially if there are only a few hundred