# Problemen met het gebruik van het disqus.rb importscript

**URL:** <https://meta.discourse.org/t/issues-with-using-disqus-rb-import-script/169984>\
**Category:** Product Support\
**Created:** [12 november 2020 om 21:10 UTC](https://meta.discourse.org/t/issues-with-using-disqus-rb-import-script/169984 "2020-11-12T21:10:33Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![astuffedtiger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astuffedtiger/32/258958_2.png) [@astuffedtiger](https://meta.discourse.org/u/astuffedtiger)\
**Post date:** [12 november 2020 om 21:10 UTC](https://meta.discourse.org/t/issues-with-using-disqus-rb-import-script/169984/1 "2020-11-12T21:10:33Z")

</div>

Greetings,

I’ve just setup Discourse but I would like to import my comments from Disqus. I noticed there’s a lovely import script, however it doesn’t seem to be working for me.

**UPDATE #2:** Ok, it seems I had some malformed XML, so I am now having the same issue [as noted here](https://meta.discourse.org/t/disqus-xml-import-it-discourse-issue/88435). The issue is that Disqus no longer includes the email address in the XML exports and in fact “hides” them in their dashboard. So maybe it just won’t be possible to import the comments unless if you add some additional code to also make up email addresses on the fly for the `create_users` function.

**UPDATE:** Actually I guess I should step back for a second. Without adjusting the `frozen_string_literal` item at the top of the script I get:

```plaintext
Traceback (most recent call last):
        6: from script/import_scripts/disqus.rb:228:in `<main>'
        5: from script/import_scripts/disqus.rb:228:in `new'
        4: from script/import_scripts/disqus.rb:21:in `initialize'
        3: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.10.10/lib/nokogiri/xml/sax/parser.rb:104:in `parse_file'
        2: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/nokogiri-1.10.10/lib/nokogiri/xml/sax/parser.rb:104:in `parse_with'
        1: from script/import_scripts/disqus.rb:176:in `characters'
script/import_scripts/disqus.rb:195:in `record': can't modify frozen String (FrozenError)

```

So, maybe that issue should be resolved first (before digging into the below)?

```plaintext
root@discourse:/var/www/discourse# su discourse -c "bundle exec ruby script/import_scripts/disqus.rb"
Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...

importing users...

importing topics...

Updating topic status

Updating bumped_at on topics

Updating last posted at on users

Updating last seen at on users

Updating first_post_created_at...

Updating user post_count...

Updating user topic_count...

Updating topic users

Updating post timings

Updating featured topic users

Updating featured topics in categories
        4 / 4 (100.0%) [3222 items/min] n]  
Resetting topic counters

Done (00h 00min 00sec)

```

I don’t know a whole lot of Ruby - actually I don’t know any, but I do know enough to try to add some debugging like `puts "#{id}"` to see if anything is getting fetched and stuff. For example I added above line 190 - `puts "#{target}"` or `puts "#{str}"` so I can see it’s definitely reading the file.

I know enough of the script is working that `IMPORT_FILE` and `IMPORT_CATEGORY` have been set properly.

Any ideas on what else I do to troubleshoot/debug?

Thanks! 💙

---

_[View the full topic](https://meta.discourse.org/t/issues-with-using-disqus-rb-import-script/169984)._
