ייבוא CSV ל-Discourse

סיכום מבוסס בינה מלאכותית

A user seeks help to import 6 CSV files, each with around 4000 rows, into Discourse as topics. The CSVs contain 7 columns for title, category, tags, and content. The user, from a non-profit, is open to paying for the work and wants a script they can run themselves. Ali3 suggests using the Discourse API, referencing a similar project with 20K topics completed in an hour using Java. honeymoose provides a code snippet demonstrating API integration for topic creation.

What would you like done?
Hi, I want to import CSV into Discourse as TOPICS, There are a total of 6 CSV, and each CSV having approximately 4000 Rows, or you can say 4000 Topics. Each CSV has 7 columns, which I created just to assign them as Title of the Topic, Topic Category, Tags, and Topic Content.

I am not an expert on this, So all I am looking for someone who can create a script, which I can run and import stuff myself if it’s easy,

When do you need it done?
I am not sure how much time this all would take, But after researching on Discourse Community Forum, I got so many topics where people mentioned that there are scripts available on Github, and we can use them to import stuff, so if that is the case then I don’t think it will take more than few hours to create a script,

What is your budget, in $ USD that you can offer for this task?
As it’s a Non-Profit Organization, totally Non Profit, we’re limited on our budget, But still I am happy to pay for your hours, Or if you’re company I will mention about your website, on my website as a Creator, so you can get credit

I think you can use Discourse API for this.

I did the same for that about 20K topic, can be done in hour.

I was using JAVA Test to make API call, the most important code as below:

        CloseableHttpClient client = HttpClients.createDefault();

        HttpPost httpPost = new HttpPost("https://www.ossez.com/posts.json");
        httpPost.setHeader(HttpHeaders.CONTENT_TYPE, "application/json; charset=UTF-8");
        httpPost.setHeader("Api-Key", "XXXXXX");
        httpPost.setHeader("Api-Username", "XXXXXX");

        TopicRequest topicRequest = new TopicRequest();
        topicRequest.setTitle(bbsOssezForumPost.getSubject());
        topicRequest.setRaw(postCtx);
        topicRequest.setCreated_at(new DateTime(bbsOssezForumPost.getDateline() * 1000L).toString() );
        topicRequest.setCategory(30);

        StringEntity postingString = new StringEntity(new Gson().toJson(topicRequest),  StandardCharsets.UTF_8);

        httpPost.setEntity(postingString);

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.