# Ning import script

**URL:** <https://meta.discourse.org/t/ning-import-script/24358>\
**Category:** Feature\
**Tags:** feedback\
**Created:** [January 23, 2015, 5:29pm UTC](https://meta.discourse.org/t/ning-import-script/24358 "2015-01-23T17:29:28Z")\
**Posts on this page:** 1\
**Showing post:** 34

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [February 18, 2016, 4:38pm UTC](https://meta.discourse.org/t/ning-import-script/24358/34 "2016-02-18T16:38:26Z")

</div>

Yeah the NING json is full of errors like missing commas, extra brackets, etc. I think I handled all of them in the repair\_json method, but you might have discovered more. It’s difficult to find out what the errors are…

To share my pain, I’ll paste the repair code here:

```plaintext
  def repair_json(arg)
    arg.gsub!(/^\(/, "") # content of file is surround by ( )
    arg.gsub!(/\)$/, "")

    arg.gsub!(/\]\]$/, "]") # there can be an extra ] at the end

    arg.gsub!(/\}\{/, "},{") # missing commas sometimes!

    arg.gsub!("}]{", "},{") # surprise square brackets
    arg.gsub!("}[{", "},{") # :troll:

    arg
  end

```

Also… note that the Ning exporter will truncate discussions to the most recent (or oldest?) 100 posts. If you have any topics with more posts than that, you’ll have to contact Ning support directly to get the full export data.

---

_[View the full topic](https://meta.discourse.org/t/ning-import-script/24358)._
