• @bentael

    Hi again, We have built the XML file and here is the link to file :
    http://dl1.sanatisharif.ir/disqus_remove_with_comment_tid.xml

    Thanks for every thing.


  • @sanatisharif few questions.

    • ok, seems like all you want to do is import the disqus comments as NodeBB reply-posts to the relevant topics, minding the timestamps of the comments.
    • How come I don't see disqus enabled on your site? did you disable it?
    • some of the disqus threads are using the same nbb:id, is that correct? for example: dsq:id="2278882614" and dsq:id="2278946707" they are both using nbb:tid="1356"
    • I am gonna need a snapshot of your NodeBB dump to test against, dont share it publicly here as it may contain sensitive info, email it to [email protected]

    This seems like one-time-use script, I can do it, but it's custom, it's not like a feature I can easily add to the -import plugin. The other thing is that I am gonna be every busy in the next 2 weeks, so that's gonna have to wait till early February


  • @bentael

    Thanks a lot . We appreciate your efforts so much.
    Here are the answers to your questions:

    • Yes, that's exactly the case.

    • As you know we have migrated to NodeBB and we don't use Disqus anymore. Do you need Disqus to be enabled ? Why?

    • Yes , that's true . we have some Disqus threads that goes to the same NodeBB topic.

    • With all due respect we can't share this in any way. But an idea for doing this could be creating some dump posts in a local NodeBB and adding some Disqus threads to those posts to see whether the plugin works or not.

    Finally about this being a one-time-script, I have to say that I disagree. I think this could be a plugin that helps anyone who wants to migrate from Disqus to NodeBB. Because in any case you have some Disqus threads that must go to a particular NodeBB topic. In the other words they gotta export their Disqus threads (which includes pots as well) and decide which thread goes to which NodeBB topic. Then they will be looking for a plugin to do the task of adding posts to NodeBB. Is that right?


  • @bentael

    we can add some input box to admin page of plugin, for customization blocks!

    function setTopicId(json,thread,callback){
      /**
      * some customization.
      *
      **/
      callback(json,thread,tid);
    }
    function getNodebbTopicId(link){
     var id = -1 ;
     /**
     *each website has their own implementation.
     *
     **/
     return id;
    }
    function getCommentID(json, callback){
    
            var threads =  json.disqus.thread ;
            var itemsProcessed = 0;
    
            for (i = 0; i < threads.length; i++) {
                try{
    
                    var link = parseInt(threads[i].link) ;
                    var id = getNodebbTopicId(link);
                    threads[i].$['nbb:tid'] = "";
                    setTopicId(json,id,threads[i],function(json,thread,tid){
                        itemsProcessed++;
                        thread.$['nbb:tid'] = tid+"";
                        if(itemsProcessed === threads.length) {
                            callback(json);
                        }
                    });
                }catch(ex){
                    itemsProcessed++;
                    console.error(ex);
                }
    
            }
    };
    var json = // Convert disqus xml file to json Object using some library, for example xml2js!
    
    getCommentID(json, function(){
    });
    

  • @sanatisharif said:

    Do you need Disqus to be enabled ? Why?

    No, i just wanted to able to verify the correctness by matching them manually.

    With all due respect we can't share this in any way. But an idea for doing this could be creating some dump posts in a local NodeBB and adding some Disqus threads to those posts to see whether the plugin works or not.

    That would work i guess.

    helps anyone who wants to migrate from Disqus to NodeBB.

    Not everyone has a nodebb-topic matching each disqus-thread, most people just use disqus as a comments system on a blogs, and migrating blogs to NodeBB isn't easy. The other issue that it involves manually adding that nbb;id thing, you had to do it manually.

    Anyways, like i mentioned, I am out of town of the next 2 weeks, i'll look at this when I get back, feel free to remind me please.


  • @bentael

    The other issue that it involves manually adding that nbb;id thing, you had to do it manually.

    We have implemented a piece of code for that and we were going to publish it . But even if he couldn't use the code , at least there is a plugin that does half of the way.

    We can't thank you enough for being so much supportive and patient. See you in couple of weeks . Good luck.


  • @bentael

    Hi I'm back again 😄 , I hope you are fine and in the mode for doing this. So how do you feel? I say let's get this done .


  • I recently migrated to NodeBB from Disqus as well, it would be great to see some easy solution for this 🙂

    By the way, @sanatisharif , since you are in the same situation you may be interested in reply/quote feature for nodebb-plugin-blog-comments. You have an example here (I think I need to change the font-size of that page 😅 ).

  • GNU/Linux Admin

    @FDX Wow, looks great! Always nice to see it in the wild 😄


  • @FDX Thanks ,we are using this feature . It sounds like dear @bentael is in the house! is not in the house! I'm happy to see that I am not alone in this. I hope we will figure it out.

  • Banned

    This post is deleted!
  • Plugin & Theme Dev

    @sanatisharif i'm still around - let me see what i can do next weekend.


  • @bentael
    Thank a lot ,I'm looking forward to it.


  • @bentael @julian
    Hi there. I hope your are fine. Since there has not been a response from you for quite a while, I got worried . Are you OK? Is there a problem? I mean I feel like suddenly something bothered you and you just dumped us! We have been waiting for you.


  • @sanatisharif please realise that @bentael is offering to do this work out of the kindness of his heart, so there must be no expectation of a response!

    I'm sure he would be happy to help you get your content migrated if you compensated him for his time 😄

  • Plugin & Theme Dev

    @sanatisharif i've been very busy for the past few weeks between my day job, family and other issues, along with bringing the importer's to support NodeBB v1.0.0 - I will take a look at this next weekend.

  • Plugin & Theme Dev

    @sanatisharif can you email me the XML Disqus export file to [email protected]? I can't find it anywhere or share it here if it's not private data


  • @julian said in Disqus importer:

    @sanatisharif please realise that @bentael is offering to do this work out of the kindness of his heart, so there must be no expectation of a response!

    I'm sure he would be happy to help you get your content migrated if you compensated him for his time 😄

    Actually that's what mean. First of all let me thank you and @bentael and all the kind developers of NodeBB community that have been so much supportive to us. I want you to know that we appreciate it a lot! What I was trying to say actually was a "Hello" message and that what is he up to. I just wanted to know whether he has time for that or not, Or (as you said) is he expecting anything in return or not? He already has been so kind and generous to us and we can't thank him enough. Thank you for informing us of this point . Perhaps my last post was a little impolite or offensive but i didn't mean it in that way at all!

    @bentael said in Disqus importer:

    @sanatisharif can you email me the XML Disqus export file to [email protected]? I can't find it anywhere or share it here if it's not private data

    Thanks for your time and patience . I hope you are fine and everything is Ok . I am going to email the file to you as soon as possible. The sender email address will be [email protected] .

  • Plugin & Theme Dev

    @sanatisharif it's ready, check your email - i need some testing data.

  • Plugin & Theme Dev

    @sanatisharif sent you the instructions email, i am going to paste it here as well for others

    For all the newusers I am going to make the assumptions of their JoinDate based on their first thread or comment;

    @sanatisharif since your importing to an existing nodebb database
    BEFORE you test it make sure make a copy of your original NodeBB database, setup a TEST NodeBB instance, and test with that before you do on your production database

    After you have that done, here are the import instructions, I am going to assume that you are using a Linux based system, or mac

    # go to the NodeBB directory you have
    cd /path/to/your/NodeBB
    
    # delete any previous import plugin you have, then a install the latest one, it was ONLY tested against NodeBB 1.0.0, but if you are running 0.9.x it should also work for you.
    rm -rf node_modules/nodebb-plugin-import
    cd node_modules 
    git pull https://github.com/akhoury/nodebb-plugin-import.git
    cd nodebb-plugin-import
    npm install
    
    # then go back up a directory and install the disqus plugin, since it's not published to npm yet, you need to do it manually
    cd ..
    git pull https://github.com/akhoury/nodebb-plugin-import-disqus.git
    cd nodebb-plugin-import-disqus
    npm install
    
    # here you need to paste your disqus XML exported dump file somewhere, let's paste it here, you dont have to do that, part
    cp /path/to/my-file.xml .
    
    
    # now go back up to run nodebb
    cd ../..
    # run NodeBB
    node app
    

Suggested Topics

| | | |